Toy project for exploring WASM / WASI
An example of static linking two libraries with an application's source code using makefiles and g++.
Details at: Static Linking
An example of dynamically linking two libraries with an application's source code using makefiles and g++.
Details at: Dynamic Linking
An example of dynamically calling a function in either of two libraries by using a CLI argument, using makefiles and g++.
Details at Runtime Dynamic Linking
An example of compiling C++ files into wasm when they share a common function name (albeit namespaced), using makefiles, emscripten, g++, and node (to run the compiled output).
Details at: Overlapping Symbols WASM
An example of compiling C++ files into a standalone .wasm via Emscripten and then running that via wasmer
Details at Emscripten into Wasmer
An example of dynamically linking (and statically linking) pre-built wasm modules together, along with timing results comparing one-shot builds (compile and link in one step), static linking, and dynamic linking. Notably, Wasmer cannot consume the dynamic library output from Emscripten, but the .js output from Emscripten can be run by node.
Details at Linking WASM
Test dynamic linking with a 1) user provided source file 2) predetermined entrypoint 3/4) multiple libraries with complex (ie. heap stored) variables.
Details at Rainbow
Test dynamic linking with a 1) user provided source file 2) predetermined entrypoint 3/4) multiple libraries with complex (ie. heap stored) variables via emscripten.
Details at Rainbow WASM
Test linking multiple languages in one combined wasm (component or module)
Details at Opaque Rainbow
Test different ways of adapting plain wasm modules into components
Details at WASM Components
Test different ways of joining wasm components
Details at Joining WASM Components
Test how accessing the file system works
Details at Wasm Filesystem
Test how making network calls works
Showcases how to make a python host to provide network utilities since WASI-Virt currently uses a different (older) version of WASI components compared to what cargo component generates with. The port is non-trivial since various functions/types have moved around in WASI between the versions.
Also gives a self-contained example of a rust host that interfaces with various external WASM files:
- a wasi cli command
- a custom library with just 1 export
- a custom library with 1 export and the standard WASI cli command imports (but no WASI exports -- ie. no run)
Details at Wasm Network