- 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.
推薦閱讀
- UI設計基礎培訓教程
- JavaScript百煉成仙
- Cross-platform Desktop Application Development:Electron,Node,NW.js,and React
- Reactive Programming with Swift
- Building Mapping Applications with QGIS
- STM32F0實戰:基于HAL庫開發
- 編寫高質量代碼:改善Objective-C程序的61個建議
- OpenMP核心技術指南
- Clojure Polymorphism
- Python Deep Learning
- Android高級開發實戰:UI、NDK與安全
- Mastering JavaScript Promises
- 深度學習的數學:使用Python語言
- Server Side development with Node.js and Koa.js Quick Start Guide
- 算法(第4版)