- 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.
推薦閱讀
- C++程序設計(第3版)
- Learning Chef
- Learning RxJava
- Hands-On Functional Programming with TypeScript
- 從零開始學C#
- 軟件測試綜合技術
- RESTful Web Clients:基于超媒體的可復用客戶端
- App Inventor 2 Essentials
- Exploring SE for Android
- Advanced Python Programming
- MySQL 8從零開始學(視頻教學版)
- Android編程權威指南(第4版)
- 安卓工程師教你玩轉Android
- Less Web Development Cookbook
- JBoss AS 7 Development