mirror of
https://github.com/exoticorn/microw8.git
synced 2026-01-20 19:26:43 +01:00
port rust tunnel example to zig
This commit is contained in:
@@ -5,14 +5,14 @@ A nightly rust compiler is needed for the unstable sqrtf32
|
||||
intrinsic.
|
||||
|
||||
Simply compiling with rustc as shown in build.sh results in a
|
||||
371 byte tunnel.wasm. Using wasm-opt this can be reduced to
|
||||
260 bytes.
|
||||
361 byte tunnel.wasm. Using wasm-opt this can be reduced to
|
||||
255 bytes.
|
||||
|
||||
When you disassemble this wasm file using wasm2wat you can see
|
||||
these globals and exports:
|
||||
|
||||
(global (;0;) i32 (i32.const 65536))
|
||||
(global (;1;) i32 (i32.const 65536))
|
||||
(global (;0;) i32 (i32.const 90000))
|
||||
(global (;1;) i32 (i32.const 90000))
|
||||
(export "__data_end" (global 0))
|
||||
(export "__heap_base" (global 1))
|
||||
|
||||
@@ -23,5 +23,5 @@ referenced by the exports and we can remove them using
|
||||
'uw8 filter-exports' (preferably before running wasm-opt) which
|
||||
removes all exports except those used by the MicroW8 platform.
|
||||
|
||||
This gives us a 216 byte wasm file. Running this through
|
||||
This gives us a 211 byte wasm file. Running this through
|
||||
uw8 pack brings us to the final size of 119 bytes.
|
||||
Reference in New Issue
Block a user