Julia on WASM - Setup instructions
This repo contains various experiments for setting up julia on wasm. It's intended for collaboration and issue tracking before things are working sufficiently to switch to the appropriate upstream repo: There's two scripts in this repo:
build_julia_wasm.shwhich will setup all the directories and build two copies of julia (one natively for cross compiling the system image, one for wasm)
rebuild_js.shwhich will rebuild just the wasm parts and dump it into the website/ directory which is a hacked up copy of https://github.com/vtjnash/JuliaWebRepl.jl
Try it out
There's two ways to try out the current state of the wasm port without building anything yourself.
- An instance of the Web REPL hosted at https://keno.github.io/julia-wasm/website/repl.htm
- Using the iodide IDE plugin (see https://alpha.iodide.io/notebooks/225/ to get started).
Both use a pre-built version that it regularly pushed to this repo. However, to save space it may be a few days out of date. Please note that this is an extremely early alpha and many things are likely (and known) to be broken.
To get started
First install the emscripten SDK and upstream LLVM using:
# Install emsdk git clone https://github.com/emscripten-core/emsdk.git cd emsdk ./emsdk install emscripten-incoming-64bit binaryen-master-64bit ./emsdk activate emscripten-incoming-64bit binaryen-master-64bit # Install upstream LLVM git clone https://github.com/llvm/llvm-project mkdir llvm-build cd llvm-build cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lld" -DCMAKE_BUILD_TYPE=Release ../llvm-project/llvm ninja # Add LLVM_ROOT = '<PATH_TO_LLVM_HERE>/llvm-build/bin' to $HOME/.emscripten # ADD llvm-build/bin to path
# Do this every time you start a session source ~/emsdk/emsdk_env.sh export PATH=<PATH_TO_LLVM_HERE>/llvm-build/bin # Do this once ./build_julia_wasm.sh # Do this after you change something on the wasm side ./rebuild_js.sh # Use this to start a web server to serve the website # Restart it when it crashes emrun --no_browser --port 8888 website/repl.htm &
At the moment
Firefox Developer Edition seems to have the most complete
wasm support and seems to be the fastest, so I'd recommend trying that.
However, due to a Firefox bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1561127) you may
After starting the server above, just navigate to