当前位置:网站首页>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!
边栏推荐
- Recommendation system - machine learning
- Shell的read 读取控制台输入、read的使用
- JVM Lecture 5: how to deal with peak push of vertical and horizontal data
- Nacos introduction and deployment
- Learn to map with nature medicine -- complex heat map
- CMD操作命令
- 【洛谷】P3919 【模板】可持久化线段树1(可持久化数组)
- CLM land surface process model
- Nacos 介绍和部署
- 推荐系统-机器学习
猜你喜欢

CLM陆面过程模式

AQS唤醒线程的时候为什么从后向前遍历,我懂了

地球系统模式(CESM)实践技术

遥感、GIS和GPS技术在水文、气象、灾害、生态、环境及卫生等领域中的应用

MySQL master-slave synchronization and master-slave synchronization delay solution

Simulation of future air pollution changes

Okaleido上线聚变Mining模式,OKA通证当下产出的唯一方式
![[weekly translation go] how to write your first program with go](/img/77/cf77a46340a39797382fd7b60517d5.png)
[weekly translation go] how to write your first program with go

Teach you how to use code to realize SSO single sign on

ALV program collection
随机推荐
SAP report development steps
Security permission management details
How to reproduce the official course of yolov5 gracefully (II) -- Mark and train your own data set
Shell的read 读取控制台输入、read的使用
Molecular skeleton transition tool -delinker introduction
C语言力扣第41题之缺失的第一个正数。两种方法,预处理快排与原地哈希
35. Search the insertion position
Okaleido上线聚变Mining模式,OKA通证当下产出的唯一方式
异步时父子线程间的ThreadLocal传递问题
I talked with the interviewer about MySQL optimization in five dimensions
【ACWing】2983. 玩具
C语言-指针进阶
[Luogu] p3919 [template] persistent segment tree 1 (persistent array)
【Leetcode】493. Reverse Pairs
Unity scene jump script
阿里三面:MQ 消息丢失、重复、积压问题,如何解决?
NetCore MySql The user specified as a definer (‘admin‘@‘%‘) does not exist
黑吃黑?男子破解赌博网站漏洞,每月“薅羊毛”10多万元
Earth system model (cesm) practical technology
第二讲 初识SLAM