Skip to content

Commit 70dd3e6

Browse files
committed
update readme
1 parent 34190ac commit 70dd3e6

14 files changed

+70
-15
lines changed

.github/workflows/all.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
with:
1212
version: 3.1.25
1313
actions-cache-folder: 'emsdk-cache'
14-
- run: make CC=gcc OPT='-O3 -fomit-frame-pointer' all
14+
- run: make CC=gcc OPT='-O3 -flto -fomit-frame-pointer' all CFLAGS+='-DWEB49_OPT_CONST0'
1515
- run: sudo cp bin/miniwasm /usr/bin/miniwasm
1616
- run: pushd ./; git clone https://github.com/wasm3/wasm3 && cd wasm3 && cmake . && sudo make -Bj install; popd
1717
- run: sudo apt install -y python3 python3-pip

README.md

+69-14
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,83 @@
11
# Web49
22

3-
Web49 contains a few tools for working with webassembly
3+
Web49 contains a few tools for working with WebAssembly.
44

5-
## miniwasm
5+
* interpreters
6+
* miniwasm
7+
* [fast](#benchmarks) wasm interpreter
8+
* uses technology from [minivm](https://github.com/fastvm/minivm)
9+
* suports multiple wasm formats
10+
* wasm binary format: ~100% complete
11+
* wasm text format: ~95% complete
12+
* wasm spect test: ~75% complete
13+
* includes a custom [WASI](https://github.com/webassembly/wasi) [implementation](src/api/wasi.c)
14+
* raywasm
15+
* wasm interpreter based on miniwasm
16+
* includes [raylib](https://github.com/raysan5/raylib) [bindings](src/api/raylib.c) [generated from](src/api/raylib.py) [json](src/api/raylib.json)
17+
* wasm binary tools rewrite
18+
* much simpler than WABT's tools
19+
* much smaller than Binaryen's tools
20+
* [wat2wasm](main/wat2wasm.c)
21+
* convert wasm text into wasm binary
22+
* [wasm2wat](main/wasm2wat.c)
23+
* generates nearly identical wat as binaryen or wabt
24+
* turn wasm binary into wasm text
25+
* supports all of wasm 1.0 and some extensions
26+
* [wasm2wasm](main/wasm2wasm.c)
27+
* shrink numbers in wasm files generated by llvm
28+
* saves 0-4 bytes per 32 bit number
29+
* saves 0-10 bytes per 64 bit number
30+
* round trip parse and reemit
631

7-
MiniWASM applies what was learned in developing MiniVM to a webassembly intepreter.
32+
## Benchmarks
833

9-
MiniVM was about 2x faster than Wasm3, with more types and more dynamism.
10-
MiniVM was natively a register-only machine, and MiniWASM too will be mostly registers.
34+
Benchmarks performed by [wasm3](https://github.com/wasm3/wasm3) and miniwasm. Ran on an 2020 Macbook Air (M1 + 8GiB ram) using [bench.py](bench.py).
1135

12-
MiniWASM intends to support all of what people use today in webassembly, tho it is still under heavy development.
36+
All Benchmarks compiled with: `emcc -O2`
1337

14-
## wasm2wat
38+
One can also view results run on [github actions](https://github.com/FastVM/Web49/actions)
39+
One can run the benchmarks for themselves.
1540

16-
The wasm2wat tool is a faster rewrite of wabt's wasm2wat, doing only the bare minimum for now.
41+
* python3
42+
* with pip
43+
* make
44+
* tested with GNUMake
45+
* works with BSDMake too
46+
* and a C compiler
47+
* gcc/clang/tcc works
48+
* msvc would work if someone rewrites two macros
49+
* #define NEXT() break
50+
* #define LABEL(X) case X:
51+
* probably a couple others
1752

18-
## wat2wasm
53+
```sh
54+
git clone https://github.com/fastvm/web49
55+
cd web49
56+
make CC=gcc # gcc is fastest in my tests
57+
python3 -m pip install matplotlib
58+
python3 bench.py
59+
```
1960

20-
The wat2wasm tool is a much faster rewrite of wabt's wat2wasm, it does not handle names correctly yet.
61+
### [Binary Trees](test/bench/binary-trees.c)
62+
![](res/binary-trees.png)
2163

22-
## wasm2wasm
64+
### [Coremark](test/bench/coremark.c)
65+
![](res/coremark.png)
2366

24-
The wasm2wasm tool intends to do the same thing as a round trip to the text format and back. Effectivly seeing the binary as it is seen by miniwasm/wasm2wat=
67+
### [Fannkuch Redux](test/bench/fannkuch-redux.c)
68+
![](res/fannkuch-redux.png)
2569

26-
# whoami
70+
### [Fibonacci on ints32_t](test/bench/fib_i32.c)
71+
![](res/fib_i32.png)
2772

28-
I am Shaw Summa, of MiniVM fame.
73+
### [Mandelbrot with SIMD](test/bench/mandelbrot-simd.c)
74+
![](res/mandelbrot-simd.png)
75+
76+
### [Mandelbrot without SIMD](test/bench/mandelbrot.c)
77+
![](res/mandelbrot.png)
78+
79+
### [Nbody](test/bench/nbody.c)
80+
![](res/nbody.png)
81+
82+
### [Executing A Trap](test/bench/trap.c)
83+
![](res/trap.png)

res/binary-trees.png

15.4 KB
Loading

res/coremark.png

15.8 KB
Loading

res/fannkuch-redux.png

16.5 KB
Loading

res/fib_f32.png

12.8 KB
Loading

res/fib_f64.png

12.7 KB
Loading

res/fib_i32.png

14.5 KB
Loading

res/fib_i64.png

14.5 KB
Loading

res/mandelbrot-simd.png

16 KB
Loading

res/mandelbrot.png

16 KB
Loading

res/nbody.png

17.3 KB
Loading

res/nop.png

15.4 KB
Loading

res/trap.png

15.6 KB
Loading

0 commit comments

Comments
 (0)