Skip to content

asciimoth/wasm-examples

Repository files navigation

wasm-examples

Some small demos written by hand to explore WASM

Repo structure

  • wasm - small examples in pure wasm. Additional code (js) needed to load and run them.
  • wasm-wasi - wasm programs that can be executed via runtime with WASI system interface support (e.g. wasmer).

Requirements

  • wabt to compile *.wat source codes to binary *.wasm progs
  • wasmer to run compiled *.wasm files with WASI interface
  • (optional) nodejs to run tests

There is also nix flake with everything needed

Run

Tests

npm test

wasm-wasi

To run wasm-wasi examples, use run script to build and run *.wat files.

wasm-wasi/run wasm-wasi/hello-world

Useful links

WAT Spec
WASM Semantics
Index of instructions

WASM Opcodes table

MDN:

Web WASM files explorer WAT to WASM online

WASM Feature Extensions and their support table

WASI docs

awesome-wasm-tools collection

webassemblyjs - WASM related stuff for JS

A complete novice writes Wasm by hand series:

coderundebug's WAT series

dkwr blog wasm posts

Writing GameOfLife in WASM

wabt.js - library to compile wat to wasm right in your js code without invoking external tools

Examples:

Nondeterminism in WebAssembly

About

Examples of written by hand wasm programs that use wasi system interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •