Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sjrd/scala-js

 
 

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

sbt:Scala.js> set Global/enableWasmEverywhere := true
sbt:Scala.js> set scalaJSLinkerConfig in testSuite.v2_12 ~= (_.withWasmFeatures(_.withTargetPureWasm(true)))
sbt:Scala.js> testSuite2_12/test

Tests don't link in pure Wasm are filtered out from unmanagedSourceDirectories and sources, see testSuiteCommonSettings.

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

Scala.js, the Scala to JavaScript compiler

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 99.8%
  • Other 0.2%