Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.46 KB

README.md

File metadata and controls

38 lines (27 loc) · 1.46 KB

Experimental Scala.js linker backend for WasmGC

CI

Usage

  • first, npm install
  • then sample/run to compile sample/src/main/scala/Sample.scala.
    • prints the WebAssembly Text Format (WAT) (Stack IR form) to the console, for debugging
    • writes the binary format (WASM) to target/output.wasm

Run the binary using through run.js using a JavaScript engine that supports WasmGC, such as Deno

$ deno run --allow-read run.mjs

Debugging tools

Testing

Requires NodeJS >= 22 (for enough support of WasmGC).

$ NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly nvm install v22
  • tests/test will
    • Run testSuite/run to compile the Scala code under test-suite to WebAssembly
    • Run the WebAssembly binary using NodeJS
  • Each Scala program in test-suite should have a function that has no arguments and return a Boolean value. The test passes if the function returns true.
  • When you add a test,
    • Add a file under test-suite
    • Add a test case to cli/src/main/scala/TestSuites.scala (methodName should be a exported function name).