当前位置:网站首页>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!
边栏推荐
- Black eat black? The man cracked the loopholes in the gambling website and "collected wool" for more than 100000 yuan per month
- ABAP grammar learning (ALV)
- An online accident, I suddenly realized the essence of asynchrony
- Getting started with ALV
- 测试用例评审如何开展
- CMD operation command
- C语言实现发牌功能基本方法
- Seata submits at details in two stages
- [Luogu] p3919 [template] persistent segment tree 1 (persistent array)
- C语言-指针进阶
猜你喜欢

CLM陆面过程模式

Earth system model (cesm) practical technology

Ansible中常用的模块

Full analysis of domain name resolution process means better text understanding

基于R语言的Meta分析【全流程、不确定性分析】方法与Meta机器学习

Nacos introduction and deployment

MySQL eight knowledge points: from getting started to deleting the database

推荐必读:测试人员如何快速熟悉新业务?

Excel VBA: realize automatic drop-down filling formula to the last line

JVM Lecture 5: how to deal with peak push of vertical and horizontal data
随机推荐
Test of countlaunch demo
五个维度着手MySQL的优化,我和面试官都聊嗨了
Excel VBA:将多个工作表保存为新文件
AQS唤醒线程的时候为什么从后向前遍历,我懂了
嵌入式分享合集20
黑吃黑?男子破解赌博网站漏洞,每月“薅羊毛”10多万元
JVM Lecture 6: how to solve the frequent FGC in online environment?
The pit of history can only be filled up as far as possible
Simulation of future air pollution changes
security权限管理详解
How many holes have you stepped on in BigDecimal?
嵌入式开发小记,实用小知识分享
Getaverse,走向Web3的远方桥梁
ALV程序收集
Redis solves the problem of oversold inventory
基于R语言的Meta分析【全流程、不确定性分析】方法与Meta机器学习
Date and time function of MySQL function summary
一次线上事故,我顿悟了异步的精髓
未来大气污染变化模拟
LeetCode链表问题——206.反转链表(一题一文学会链表)