- Learn WebAssembly
- Mike Rourke
- 170字
- 2021-08-13 15:38:55
C code to Wat
The upper-left pane in the following screenshot contains a simple C function that adds 2 to the number specified as a parameter. The lower-left pane contains the corresponding Wat:
If this looks familiar, it's because this same code was used for the explanation of Wat's s-expressions in the beginning of this chapter. Digging a little deeper, you can see how the C code corresponds to the Wat output. The addTwo() function is exported from the module as a string on line 5. Line 5 also contains (func $addTwo), which references the $addTwo function on line 6. Line 6 specifies that a single parameter of type i32 (an integer) can be passed in and the result returned is also an i32. Pressing the Build button in the upper-right corner (or above the C/C++ editor) will compile the C code into a Wasm file. The Wasm will be available for download or interaction with JavaScript once the build is completed.
- PyTorch自動駕駛視覺感知算法實戰
- Cocos2d-x游戲開發:手把手教你Lua語言的編程方法
- Learning RabbitMQ
- Developing Middleware in Java EE 8
- 數據結構與算法JavaScript描述
- Visual Basic程序設計實驗指導(第4版)
- SQL Server 2016數據庫應用與開發習題解答與上機指導
- 精通網絡視頻核心開發技術
- Apache Mesos Essentials
- Hands-On Swift 5 Microservices Development
- 領域驅動設計:軟件核心復雜性應對之道(修訂版)
- Python3.5從零開始學
- C/C++數據結構與算法速學速用大辭典
- Image Processing with ImageJ
- Go語言開發實戰(慕課版)