Skip to content

scala-wasm/scala-wasm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scala-wasm

CI

This is a friendly fork of Scala.js, targeting stand-alone Wasm runtimes such as wasmtime, leveraging WASIp2 and Wasm Component Model.

Prequirements

Examples

Test

test-suite-wasi

Copy of test-suites that works without JS-interop (except for some "essential imports").

sbt:Scala.js> set Global/enableWasmEverywhere := true
sbt:Scala.js> testSuiteWASI2_12/run

test-component-model

Test suites for Wasm Component Model based interop.

Build Wasm Compoennt from Scala.

$ sbt
sbt:Scala.js> set Global/enableWasmEverywhere := true
sbt:Scala.js> testComponentModel2_12/fastLinkJS

$ cd examples/test-component-model
$ wasm-tools component embed wit .2.12/target/scala-2.12/testing-module-for-component-model-fastopt/main.wasm -o main.wasm -w scala --encoding utf16
$ wasm-tools component new main.wasm -o main.wasm

Build Wasm Components from Rust.

$ cd examples/test-component-model/rust-exports
$ cargo component build --target wasm32-wasip2 -r

$ cd examples/test-component-model/rust-run
$ cargo component build --target wasm32-wasip2 -r

Compose Wasm Components and run.

$ wac plug --plug rust-exports/target/wasm32-wasip1/release/rust_exports.wasm main.wasm -o scala.wasm
$ wac plug --plug scala.wasm rust-run/target/wasm32-wasip1/release/rust_run.wasm -o out.wasm

$ wasmtime -W function-references,gc -C collector=null out.wasm

Once we implement wit-bindgen for us, this tests should migrate to https://github.com/bytecodealliance/wit-bindgen


What follows below is README.md of the upstream scala-js project


Scala.js

Chat: #scala-js on Discord.

This is the repository for Scala.js, the Scala to JavaScript compiler.

License

Scala.js is distributed under the Apache License Version 2.0.

About

Friendly fork of Scala.js, target stand-alone Wasm leveraging WASI and Component Model

Resources

License

Stars

Watchers

Forks

Languages

  • Scala 99.8%
  • Other 0.2%