A WebAssembly interpreter for Scala 3 with a WASI Preview 1 host shim and a small CLI. All three pieces are cross-platform (JVM, Scala.js, Scala Native) and share one codebase.
Full reference at https://edadma.github.io/wasm/ — installation, quickstart, supported opcodes, WASI surface, CLI flags, host imports, spec compliance, and contributor docs.
libraryDependencies ++= Seq(
"io.github.edadma" %%% "wasm" % "0.4.0",
"io.github.edadma" %%% "wasm-wasi" % "0.4.0", // optional — only if you want the WASI shim
)git clone https://github.com/edadma/wasm
cd wasm
sbt 'cliJVM/run examples/hello.wasm'
# Hello, world!Or against a real rustc-built WASI binary with a host-backed preopen:
mkdir -p /tmp/sandbox
echo "Hello from the host filesystem" > /tmp/sandbox/hello.txt
sbt 'cliJVM/run --preopen /tmp/sandbox:/sandbox \
wasi/shared/src/test/resources/fixtures/real_rust_fileread.wasm'
# Hello from the host filesysteminterp/— the interpreter. Zero external dependencies (Scala stdlib only). Published aswasm.wasi/— WASI Preview 1 host shim (29 syscalls). Zero external deps, depends oninterp. Published aswasm-wasi.cli/— a small command-line runner. Not published; runnable example.
See Development → Architecture for the full source-tree layout, and Development → Testing for the unit suites, W3C testsuite runner, and fixture regeneration.
881 tests on JVM (653 interp + 209 wasi + 19 cli), all green; interp + wasi also green on Scala.js (Node 20+) and Scala Native (0.5.11). W3C testsuite slice: 133 of 142 manifests fully green, 9 pinned in KnownFailures with documented residuals. See docs/spec-compliance for details.
ISC — see LICENSE.