当前位置:网站首页>Webassembly 01 basic information
Webassembly 01 basic information
2022-07-26 05:13:00 【longji】
01 Basic tools
WebAssembly Text format (.wat) and WebAssembly Assembly format (.wasm) The relationship between assembly code and machine code is similar .
01.01 wabt Toolset
wabt The toolset provides .wat and .wasm A tool for converting files to each other .
wabt Toolset github Address :
https://github.com/WebAssembly/wabt/releases
win:https://github.com/WebAssembly/wabt/releases/download/1.0.29/wabt-1.0.29-windows.tar.gz
mac:https://github.com/WebAssembly/wabt/releases/download/1.0.29/wabt-1.0.29-macos.tar.gz
linux:https://github.com/WebAssembly/wabt/releases/download/1.0.29/wabt-1.0.29-ubuntu.tar.gz
The above corresponds to wabt edition , After decompressing , Add environment variables .
You can also download the complete source code , There are some in it demo.
git clone --recursive https://github.com/WebAssembly/wabt.git
cd wabt
git submodule update --init
## linux and macos
mkdir build
cd build
cmake ..
cmake --build .
## windows vs
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=..\ -G "Visual Studio 17 2022"
cmake --build . --config DEBUG --target install
01.02 emsdk
git clone https://github.com/juj/emsdk.git --depth=1
cd emsdk
git pull
# Current stable version
#emsdk install sdk-3.1.17-64bit
emsdk install 3.1.17
# View version information
emcc -v
01.03 Online verification demo
https://webassembly.github.io/wabt/demo/wat2wasm/
01.04 Official documents
wasm Syntax update faster , Try to read the grammar instructions on the official website . Really not line , Find it directly in the source code .
https://webassembly.org/getting-started/developers-guide/
hell_world.c
#include <stdio.h>
int main() {
printf("hello, world!");
return 0;
}
# Default generation a.out.js,a.out.wasm
./emcc tests/hello_world.c
node a.out.js
# You can specify -o Output .html file , Convenient test (hello.js, hello.wasm, hello.html)
./emcc tests/hello_world.c -o hello.html
# Browser open hello.html, In debugging state , console window , You can see the output : hello, world!
边栏推荐
- JVM Lecture 6: how to solve the frequent FGC in online environment?
- 嵌入式分享合集21
- Black eat black? The man cracked the loopholes in the gambling website and "collected wool" for more than 100000 yuan per month
- MySQL master-slave synchronization and master-slave synchronization delay solution
- 异步时父子线程间的ThreadLocal传递问题
- 关于负数表示的数值为什么比整数大1?
- Shell流程控制(重点)、if 判断、case 语句、let用法、for 循环中有for (( 初始值;循环控制条件;变量变化 ))和for 变量 in 值 1 值 2 值 3… 、while 循环
- 手把手教你用代码实现SSO单点登录
- mysql函数汇总之日期和时间函数
- Redis solves the problem of oversold inventory
猜你喜欢

Five simple and practical daily development functions of chrome are explained in detail. Unlock quickly to improve your efficiency!

Please elaborate on the implementation principle of synchronized and related locks
![Meta analysis [whole process, uncertainty analysis] method based on R language and meta machine learning](/img/87/9f8353c5c9c700eaa63f66697aa44a.png)
Meta analysis [whole process, uncertainty analysis] method based on R language and meta machine learning

Nacos 介绍和部署

5个chrome简单实用的日常开发功能详解,赶快解锁让你提升更多效率!

【ACWing】2983. 玩具

nacos注册中心

提高shuffle操作中的reduce并行度

C language function

Excel VBA:实现自动下拉填充公式至最后一行
随机推荐
注解@Autowired如何自动装配
新导则下的防洪评价报告编制方法及洪水建模
关于负数表示的数值为什么比整数大1?
[acwing] 1268. Simple questions
Ansible中常用的模块
ALV program collection
五个维度着手MySQL的优化,我和面试官都聊嗨了
基于R语言的Meta分析【全流程、不确定性分析】方法与Meta机器学习
Practical technology of SWAT Model in simulation of hydrology, water resources and non-point source pollution
DOM事件流 事件冒泡-事件捕获-事件委托
黑吃黑?男子破解赌博网站漏洞,每月“薅羊毛”10多万元
域名解析过程全分析,就着文字理解更佳
An online accident, I suddenly realized the essence of asynchrony
嵌入式开发小记,实用小知识分享
Excel VBA:实现自动下拉填充公式至最后一行
ALV report flow diagram
Ansible tutorial
CMD操作命令
NPM operation instruction
【ACWing】2983. 玩具