Skip to content

shadaj/scala-native-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scala Native on WebAssembly Demo

First, locally publish scala-native/scala-native#1363 with sbt rebuild_x32.

Then, run the Scala Native linker with sbt nativeLink, this will produce errors during compilation and linking, but this is okay because we only care about the generated LLVM.

Finally, run Emscripten to compile to WebAssembly:

emcc target/scala-2.11/native/lib/*.c target/scala-2.11/native/lib/gc/none/**.c target/scala-2.11/native/lib/*.cpp target/scala-2.11/native/*.ll -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -o index.html

Then open up index.html in a web browser (you may need to serve the directory as a local server due to security restrictions).

About

Running Scala in WebAssembly through Scala Native

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages