# Status of WebAssembly (for Julia), e.g. threads and GC

**URL:** https://discourse.julialang.org/t/status-of-webassembly-for-julia-e-g-threads-and-gc/89331
**Category:** Offtopic
**Created:** [October 26, 2022, 8:49pm UTC](https://discourse.julialang.org/t/status-of-webassembly-for-julia-e-g-threads-and-gc/89331 "2022-10-26T20:49:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [October 26, 2022, 8:49pm UTC](https://discourse.julialang.org/t/status-of-webassembly-for-julia-e-g-threads-and-gc/89331/1 "2022-10-26T20:49:02Z")

</div>

I see threads are going up to Phase 3 - Implementation Phase (where GC already is): [proposals/README.md at d2f6ce711249d37fc21a8933de1f7903cb521302 · WebAssembly/proposals · GitHub](https://github.com/WebAssembly/proposals/blob/d2f6ce711249d37fc21a8933de1f7903cb521302/README.md)

It’s ~~not done~~ but both would help Julia. Julia can already run in WebAssemly with its own GC. Do you see anything there important for Julia, or good to have such as GC, not needing to provide your own. I guess couldn’t provide threads even if it wanted (except for green threading).

[https://webassembly.org/roadmap/](https://webassembly.org/roadmap/)

I actually that some of the “In-progress proposals” are actually already done (just not part of the standard yet), e.g. “[Threads and atomics](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md)”, I suppose the same thing (and [Exception handling](https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md)) in the major web browsers: [Roadmap - WebAssembly](https://webassembly.org/roadmap/)

Anything important going on for Julia with WebAssembly, as is, i.e. not needed any changes?

---

<div class="post-metadata">

### Author: ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)
#### Post date: [October 26, 2022, 8:50pm UTC](https://discourse.julialang.org/t/status-of-webassembly-for-julia-e-g-threads-and-gc/89331/2 "2022-10-26T20:50:28Z")

</div>

[![](https://global.discourse-cdn.com/julialang/original/3X/7/3/733ad7526f0f95f5bc59c75271ff97047e63a1d8.jpeg "Julia Language on WebAssembly: Our Wish List and Experience So Far") ](https://www.youtube.com/watch?v=DUumYxjK1Xs)

---

<div class="post-metadata">

### Author: ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)
#### Post date: [October 27, 2022, 9:33am UTC](https://discourse.julialang.org/t/status-of-webassembly-for-julia-e-g-threads-and-gc/89331/3 "2022-10-27T09:33:28Z")

</div>

> [@Palli](#):
>
> Anything important going on for Julia with WebAssembly, as is, i.e. not needed any changes?

What do you mean by “not needed any changes”? You mean to ask “Anything important going on for Julia with WebAssembly, as in, is there anything that can be used nowadays?”

If that’s the question, then

> **[GitHub - Keno/julia-wasm: Running julia on wasm](https://github.com/Keno/julia-wasm)**
>
> Running julia on wasm. Contribute to Keno/julia-wasm development by creating an account on GitHub.

and

> **[⚡ Pluto.jl ⚡](https://pluto-wasm-backend.netlify.app/editor.html)**
>
> Pluto.jl notebooks

Are probably still the most important repositories.

There is also

> **[GitHub - MikeInnes/WebAssembly.jl](https://github.com/MikeInnes/WebAssembly.jl)**
>
> Contribute to MikeInnes/WebAssembly.jl development by creating an account on GitHub.

but that seems to be there to modify the internal representation (IR) and not to generate Julia.

Having said that, and I’m happy to be proven wrong here, without static compilation I don’t see how Julia is going to support WebAssembly. Since types can always be `Any`, you don’t know for sure what dispatches you have to prepare meaning that you have to bring the compiler along which just isn’t very pleasant if you’re developing things for browsers. It would mean that browsers have to download the compiler every time. Alternatively you could enforce that all types are known so that it is fully static, but that makes programming in Julia and using Julia Base a lot more difficult.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [October 27, 2022, 10:59am UTC](https://discourse.julialang.org/t/status-of-webassembly-for-julia-e-g-threads-and-gc/89331/4 "2022-10-27T10:59:06Z")

</div>

> [@rikh](#):
>
> You mean to ask “Anything important going on for Julia with WebAssembly, as in, is there anything that can be used nowadays?”

No, I know you can already (but was surprised to see what was done used the Julia interpreter, not compiling, so that would be one more reason slower on the web).

I meant for what is already possible, to run Julia with WebAssembly, can it be improved? I’m sure it can. But are we blocked on something, would we rather want WebAssembly extended, and are waiting on e.g. GC to be added?

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [November 7, 2024, 2:45pm UTC](https://discourse.julialang.org/t/status-of-webassembly-for-julia-e-g-threads-and-gc/89331/5 "2024-11-07T14:45:48Z")

</div>

Since I wrote this WebGC has been enabled by default in August (on Github) in Safari/Webkit software, but unclear if it will be released in Safari 19 or sooner. It was the last major holdout, so now it’s good to target WebAssembly, AND use WebGC (not sure anyone has tried the latter) for Julia.

I.e. closed:  
[https://bugs.webkit.org/show\_bug.cgi?id=272004](https://bugs.webkit.org/show_bug.cgi?id=272004)

Though still open (outdated?):  
[https://bugs.webkit.org/show\_bug.cgi?id=247394](https://bugs.webkit.org/show_bug.cgi?id=247394)
