Running Julia in browser - sharing simulation code that plots live. Possible?

It’s actually possible at least two ways:

A.
Here’s a demo for sort of exactly what you need, right:

Note, that compiler still has some limitations, e.g. only works in brand-new web browsers:

This will run Julia in a web browser, just use a web server to serve that code.

[It’s also possible in other ways to have Julia run on the web server and serve you JavaScript, even compiled from Julia, though likely not for exactly as you want, or at least as a drop-in replacement for Makie.]

B.
You can use Pluto notebooks, then you share all the code with the world, it’s at least visible by default, and not precompiled for the web browser. It should support all Julia code, and Makie, but since it’s in a web browser, not the desktop usual version of it rather WGLMakie subproject that likely is good enough and is for all (modern) web browsers:

juliaplots.org/WGLMakie.jl/dev/#Pluto/IJulia

Yes, with this plan B the user would need Julia preinstalled:

Introduction to Computational Thinking [ANN] Arblib.jl

It suggest latest stable, mentioning 1.6.0 but that’s not the latest, I would suggest using 1.94 (or even later, 1.10 is about to be released, rc2 might be ok/better).

I wouldn’t use 1.6.x for anything, I think the docs are just outdated, though (latest) 1.6.x should also work.

Hopefully at some point those approaches will get merged and you can use B. without preinstalling, with help of A. or just A alone for arbitrary Julia code.

1 Like