- Learn WebAssembly
- Mike Rourke
- 139字
- 2021-08-13 15:38:52
Values, types, and instructions
Although detailed coverage of the Text Format section of the Core Specification is out of the scope of this text, it's worth demonstrating how some of the language concepts map to the corresponding Wat. The following diagram demonstrates these mappings in a sample Wat snippet. The C code that this was compiled from represents a function that takes a word as a parameter and returns the square root of the character count:
Wat example with language concept details
If you intend on writing or editing Wat, note that it supports block and line comments. The instructions are split up into blocks and consist of setting and getting memory associated with variables with valid types. You are able to control the flow of logic using if statements and loops are supported using the loop keyword.
推薦閱讀
- 深入核心的敏捷開發(fā):ThoughtWorks五大關(guān)鍵實(shí)踐
- 零基礎(chǔ)玩轉(zhuǎn)區(qū)塊鏈
- Learn Scala Programming
- Expert Android Programming
- Mastering KnockoutJS
- 名師講壇:Spring實(shí)戰(zhàn)開發(fā)(Redis+SpringDataJPA+SpringMVC+SpringSecurity)
- Advanced Oracle PL/SQL Developer's Guide(Second Edition)
- Mastering JavaScript High Performance
- 青少年信息學(xué)競(jìng)賽
- Python爬蟲、數(shù)據(jù)分析與可視化:工具詳解與案例實(shí)戰(zhàn)
- Scala for Machine Learning(Second Edition)
- 基于GPU加速的計(jì)算機(jī)視覺編程:使用OpenCV和CUDA實(shí)時(shí)處理復(fù)雜圖像數(shù)據(jù)
- Raspberry Pi Blueprints
- 深入理解Java虛擬機(jī):JVM高級(jí)特性與最佳實(shí)踐
- JavaScript Concurrency