ChrisRackauckas 4 hours ago

Yeah the WebAssemblyCompiler.jl works on things that are StaticCompiler-able https://tshort.github.io/WebAssemblyCompiler.jl/stable/examp..., plus a little bit more since it supports the GC. It's not an "official" compiler and it has some things that mean it's on the "not really maintained list", but it shows it's not too difficult. You can also just retarget LLVM yourself to WASM (it's just a backend of LLVM) without too much difficulty if you're using a limited part of the Julia runtime. So... with a bit of effort a good chunk of the language could do this, we just haven't had much of the effort since most of it has been going towards AOT binary building.

sundarurfriend 8 hours ago

I don't think so, not yet. There's been Julia-on-wasm efforts that have been inching along for a while, but it's not nearly at a mature point afaik. I remember reading that some new developments (maybe shifting more of the compiler work to Julia with JuliaLowering.jl, maybe something else) have made wasm a lot more feasible, but it's gonna need some people with a need for it to actually work on it.

(From context I'm assuming you're not looking for something like Jupyter/Pluto/BonitoBook.)

  • ChrisRackauckas 4 hours ago

    The part that made it much more feasible is that WASM's "new" GC ended up working nicely with Julia's GC, so WebAssemblyCompiler.jl was able to hook into it. With that, a lot more codes suddenly work because array allocations are fine. It means that in this state if someone took it seriously I think a pretty good version could be had in like 6 months, but it would take a real effort to make that something actually part of the "normal" maintained compiler stack.