Julia → WebAssembly GC · no Julia runtime

The Lorenz attractor, solved in your browser by Julia

Every change re-solves the system with OrdinaryDiffEq's Tsit5 adaptive Runge–Kutta method over t ∈ [0, 40], saving a point every 0.01. The solver was compiled from Julia to WasmGC; its integrator was built in Julia ahead of time and is part of the module.

ẋ = σ(y − x)
ẏ = x(ρ − z) − y
ż = xy − βz
Solve–
Steps–
Points–
Loading the module…
t = 0t = 40

Compiled like juliac

WasmCodegen collects the closed world of code the exported functions can run with Julia's own inference, as juliac --trim=safe does, structures its control flow and emits WebAssembly with garbage-collected structs and arrays.

Objects in the module

The integrator (init(prob, Tsit5(); saveat = 0.01)) is built natively when the module is compiled, then serialized into it: 148 Julia objects, its caches and Butcher tableau included. The page sets p and u₀, then calls reinit! and solve!.

This module

232 KB of WebAssembly, 77 functions, no imports. Native Julia on the build machine solves the classic case in about 0.6 ms; the timing on this page is your browser's.