Charlotte's WebAssembly backend currently supports simple numerical kernels, and could be productively used as a sort of scripting language over WASM.
julia> relu(x) = ifelse(x < 0, 0, x) relu (generic function with 1 method) julia> @code_wasm relu(1) (func (param i64) (result i64) (i64.const 0) (get_local 0) (get_local 0) (i64.const 0) (i64.lt_s) (select) (return))
Julia code secretly comes in two dialects:
- Static Julia is more like C, with tight numerical loops that operate over arrays and other well-typed containers. This code can be aggressively optimised by ahead-of-time compilers, like LLVM.
In early prototypes the difference between the dialects will be fairly stark; the dynamic subset is essentially a syntax layer over JS, while the static subset only supports basic numerics. As more features are added both should converge to standard Julia, and the difference will become seamless for most users.
See here for a more detailed outline of the static compile pipeline.