WASM:

https://github.com/Hanks10100/wasm-examples/tree/master/simple

 

mkdir hello
 cd hello
 echo '#include <stdio.h>' > hello.c
 echo 'int main(int argc, char ** argv) {' >> hello.c
 echo 'printf("Hello, world!\n");' >> hello.c
 echo '}' >> hello.c
 emcc hello.c -s WASM=1 -o hello.htmlprintf '#include<iostream> \nint main() { std::cout<<"hello world"<<std::endl; return 0;}' >  helloworld.cpp
 docker run   --rm  -v $(pwd):/src  trzeci/emscripten emcc helloworld.cpp -o helloworld.html

docker run --rm -v $(pwd):/src trzeci/emscripten emcc math.c -Os -s WASM=1 -s SIDE_MODULE=1 -o math.wasm

python3 -m http.server 8080 #此时打开localhost:8080即可看到相应页面

emcc math.c -Os -s WASM=1 -s SIDE_MODULE=1 -o math.wasm

https://github.com/Hanks10100/wasm-examples