- 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.
推薦閱讀
- 編程的修煉
- Visual Basic程序開發(fā)(學(xué)習(xí)筆記)
- SpringMVC+MyBatis快速開發(fā)與項(xiàng)目實(shí)戰(zhàn)
- 計(jì)算機(jī)圖形學(xué)編程(使用OpenGL和C++)(第2版)
- 實(shí)戰(zhàn)低代碼
- Quarkus實(shí)踐指南:構(gòu)建新一代的Kubernetes原生Java微服務(wù)
- JavaScript 程序設(shè)計(jì)案例教程
- Scala編程實(shí)戰(zhàn)(原書第2版)
- SSM開發(fā)實(shí)戰(zhàn)教程(Spring+Spring MVC+MyBatis)
- The Professional ScrumMaster’s Handbook
- Java零基礎(chǔ)實(shí)戰(zhàn)
- Xcode 6 Essentials
- QlikView Unlocked
- Simulation for Data Science with R
- 現(xiàn)代CPU性能分析與優(yōu)化