wasm-idle 0.7.2 → 1.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +507 -38
- package/dist/index.d.ts +4 -9
- package/dist/index.js +2 -4
- package/dist/playground/assemblyscript.d.ts +27 -0
- package/dist/playground/assemblyscript.js +158 -0
- package/dist/playground/assetBridge.js +8 -10
- package/dist/playground/assets.d.ts +334 -9
- package/dist/playground/assets.js +963 -145
- package/dist/playground/awk.d.ts +5 -0
- package/dist/playground/awk.js +16 -0
- package/dist/playground/bash.d.ts +43 -0
- package/dist/playground/bash.js +191 -0
- package/dist/playground/bqn.d.ts +5 -0
- package/dist/playground/bqn.js +17 -0
- package/dist/playground/clang.d.ts +9 -13
- package/dist/playground/clang.js +38 -26
- package/dist/playground/clojurescript.d.ts +5 -0
- package/dist/playground/clojurescript.js +16 -0
- package/dist/playground/cobol.d.ts +30 -0
- package/dist/playground/cobol.js +185 -0
- package/dist/playground/d.d.ts +27 -0
- package/dist/playground/d.js +165 -0
- package/dist/playground/dotnet.d.ts +74 -0
- package/dist/playground/dotnet.js +293 -0
- package/dist/playground/duckdb.d.ts +22 -0
- package/dist/playground/duckdb.js +112 -0
- package/dist/playground/elixir.d.ts +8 -9
- package/dist/playground/elixir.js +43 -28
- package/dist/playground/forth.d.ts +5 -0
- package/dist/playground/forth.js +16 -0
- package/dist/playground/fortran.d.ts +30 -0
- package/dist/playground/fortran.js +193 -0
- package/dist/playground/gleam.d.ts +5 -0
- package/dist/playground/gleam.js +17 -0
- package/dist/playground/go.d.ts +10 -10
- package/dist/playground/go.js +62 -26
- package/dist/playground/goDebugInstrumentation.d.ts +1 -0
- package/dist/playground/goDebugInstrumentation.js +229 -0
- package/dist/playground/haskell.d.ts +27 -0
- package/dist/playground/haskell.js +190 -0
- package/dist/playground/index.d.ts +1 -1
- package/dist/playground/index.js +338 -107
- package/dist/playground/j.d.ts +5 -0
- package/dist/playground/j.js +17 -0
- package/dist/playground/janet.d.ts +5 -0
- package/dist/playground/janet.js +15 -0
- package/dist/playground/java.d.ts +5 -9
- package/dist/playground/java.js +21 -14
- package/dist/playground/julia.d.ts +5 -0
- package/dist/playground/julia.js +14 -0
- package/dist/playground/lisp.d.ts +27 -0
- package/dist/playground/lisp.js +165 -0
- package/dist/playground/loadingProgress.d.ts +22 -0
- package/dist/playground/loadingProgress.js +76 -0
- package/dist/playground/lua.d.ts +27 -0
- package/dist/playground/lua.js +165 -0
- package/dist/playground/nim.d.ts +5 -0
- package/dist/playground/nim.js +14 -0
- package/dist/playground/objectivec.d.ts +39 -0
- package/dist/playground/objectivec.js +255 -0
- package/dist/playground/ocaml.d.ts +5 -9
- package/dist/playground/ocaml.js +44 -44
- package/dist/playground/octave.d.ts +34 -0
- package/dist/playground/octave.js +193 -0
- package/dist/playground/options.d.ts +9 -40
- package/dist/playground/options.js +2 -1
- package/dist/playground/pascal.d.ts +5 -0
- package/dist/playground/pascal.js +16 -0
- package/dist/playground/perl.d.ts +5 -0
- package/dist/playground/perl.js +16 -0
- package/dist/playground/php.d.ts +27 -0
- package/dist/playground/php.js +162 -0
- package/dist/playground/prolog.d.ts +5 -0
- package/dist/playground/prolog.js +16 -0
- package/dist/playground/python.d.ts +9 -13
- package/dist/playground/python.js +38 -23
- package/dist/playground/r.d.ts +27 -0
- package/dist/playground/r.js +167 -0
- package/dist/playground/ruby.d.ts +28 -0
- package/dist/playground/ruby.js +166 -0
- package/dist/playground/runtimeModule.d.ts +1 -0
- package/dist/playground/runtimeModule.js +5 -0
- package/dist/playground/rust.d.ts +11 -10
- package/dist/playground/rust.js +71 -28
- package/dist/playground/sandbox.d.ts +2 -4
- package/dist/playground/sharedBuffer.d.ts +6 -0
- package/dist/playground/sharedBuffer.js +12 -0
- package/dist/playground/sqlite.d.ts +23 -0
- package/dist/playground/sqlite.js +117 -0
- package/dist/playground/staticRuntimeModuleVersion.d.ts +1 -0
- package/dist/playground/staticRuntimeModuleVersion.js +2 -0
- package/dist/playground/staticWorkerRuntime.d.ts +71 -0
- package/dist/playground/staticWorkerRuntime.js +356 -0
- package/dist/playground/stdinBuffer.d.ts +9 -7
- package/dist/playground/stdinBuffer.js +3 -0
- package/dist/playground/swift.d.ts +5 -0
- package/dist/playground/swift.js +14 -0
- package/dist/playground/tcl.d.ts +5 -0
- package/dist/playground/tcl.js +16 -0
- package/dist/playground/teavmConfig.d.ts +1 -1
- package/dist/playground/teavmConfig.js +2 -2
- package/dist/playground/tinygo.d.ts +6 -14
- package/dist/playground/tinygo.js +110 -208
- package/dist/playground/typescript.d.ts +32 -0
- package/dist/playground/typescript.js +176 -0
- package/dist/playground/wasm.d.ts +26 -0
- package/dist/playground/wasm.js +151 -0
- package/dist/playground/wasmAwkVersion.d.ts +1 -0
- package/dist/playground/wasmAwkVersion.js +1 -0
- package/dist/playground/wasmBashVersion.d.ts +1 -0
- package/dist/playground/wasmBashVersion.js +1 -0
- package/dist/playground/wasmBqnVersion.d.ts +1 -0
- package/dist/playground/wasmBqnVersion.js +1 -0
- package/dist/playground/wasmClojureScriptVersion.d.ts +1 -0
- package/dist/playground/wasmClojureScriptVersion.js +1 -0
- package/dist/playground/wasmDVersion.d.ts +1 -0
- package/dist/playground/wasmDVersion.js +1 -0
- package/dist/playground/wasmDotnetVersion.d.ts +1 -0
- package/dist/playground/wasmDotnetVersion.js +1 -0
- package/dist/playground/wasmForthVersion.d.ts +1 -0
- package/dist/playground/wasmForthVersion.js +1 -0
- package/dist/playground/wasmFortranVersion.d.ts +1 -0
- package/dist/playground/wasmFortranVersion.js +1 -0
- package/dist/playground/wasmGleamVersion.d.ts +1 -0
- package/dist/playground/wasmGleamVersion.js +1 -0
- package/dist/playground/wasmGoVersion.d.ts +1 -1
- package/dist/playground/wasmGoVersion.js +1 -1
- package/dist/playground/wasmHaskellVersion.d.ts +1 -0
- package/dist/playground/wasmHaskellVersion.js +1 -0
- package/dist/playground/wasmJVersion.d.ts +1 -0
- package/dist/playground/wasmJVersion.js +1 -0
- package/dist/playground/wasmJanetVersion.d.ts +1 -0
- package/dist/playground/wasmJanetVersion.js +1 -0
- package/dist/playground/wasmJuliaVersion.d.ts +1 -0
- package/dist/playground/wasmJuliaVersion.js +1 -0
- package/dist/playground/wasmLispVersion.d.ts +1 -0
- package/dist/playground/wasmLispVersion.js +1 -0
- package/dist/playground/wasmLuaVersion.d.ts +1 -0
- package/dist/playground/wasmLuaVersion.js +1 -0
- package/dist/playground/wasmNimVersion.d.ts +1 -0
- package/dist/playground/wasmNimVersion.js +1 -0
- package/dist/playground/wasmObjectiveCVersion.d.ts +1 -0
- package/dist/playground/wasmObjectiveCVersion.js +1 -0
- package/dist/playground/wasmOcamlVersion.d.ts +1 -1
- package/dist/playground/wasmOcamlVersion.js +1 -1
- package/dist/playground/wasmOctaveVersion.d.ts +1 -0
- package/dist/playground/wasmOctaveVersion.js +1 -0
- package/dist/playground/wasmPascalVersion.d.ts +1 -0
- package/dist/playground/wasmPascalVersion.js +1 -0
- package/dist/playground/wasmPerlVersion.d.ts +1 -0
- package/dist/playground/wasmPerlVersion.js +1 -0
- package/dist/playground/wasmPrologVersion.d.ts +1 -0
- package/dist/playground/wasmPrologVersion.js +1 -0
- package/dist/playground/wasmRVersion.d.ts +1 -0
- package/dist/playground/wasmRVersion.js +1 -0
- package/dist/playground/wasmRustVersion.d.ts +1 -1
- package/dist/playground/wasmRustVersion.js +1 -1
- package/dist/playground/wasmSwiftVersion.d.ts +1 -0
- package/dist/playground/wasmSwiftVersion.js +1 -0
- package/dist/playground/wasmTclVersion.d.ts +1 -0
- package/dist/playground/wasmTclVersion.js +1 -0
- package/dist/playground/wasmTypeScriptVersion.d.ts +1 -0
- package/dist/playground/wasmTypeScriptVersion.js +1 -0
- package/dist/playground/wasmWatVersion.d.ts +1 -0
- package/dist/playground/wasmWatVersion.js +1 -0
- package/dist/playground/wasmZigVersion.d.ts +1 -0
- package/dist/playground/wasmZigVersion.js +1 -0
- package/dist/playground/wat.d.ts +27 -0
- package/dist/playground/wat.js +162 -0
- package/dist/playground/worker/assemblyscript.js +331 -0
- package/dist/playground/worker/clang.js +48 -9
- package/dist/playground/worker/cobol.js +104 -0
- package/dist/playground/worker/d.js +156 -0
- package/dist/playground/worker/dotnet.js +128 -0
- package/dist/playground/worker/duckdb.js +128 -0
- package/dist/playground/worker/elixir.js +176 -12
- package/dist/playground/worker/fortran.d.ts +1 -0
- package/dist/playground/worker/fortran.js +267 -0
- package/dist/playground/worker/go.js +208 -33
- package/dist/playground/worker/haskell.d.ts +7 -0
- package/dist/playground/worker/haskell.js +363 -0
- package/dist/playground/worker/java.js +2 -0
- package/dist/playground/worker/lisp.d.ts +1 -0
- package/dist/playground/worker/lisp.js +161 -0
- package/dist/playground/worker/lua.d.ts +1 -0
- package/dist/playground/worker/lua.js +155 -0
- package/dist/playground/worker/objectivec.d.ts +1 -0
- package/dist/playground/worker/objectivec.js +8 -0
- package/dist/playground/worker/ocaml.js +24 -24
- package/dist/playground/worker/php.d.ts +1 -0
- package/dist/playground/worker/php.js +153 -0
- package/dist/playground/worker/python.js +93 -39
- package/dist/playground/worker/r.d.ts +1 -0
- package/dist/playground/worker/r.js +184 -0
- package/dist/playground/worker/ruby.d.ts +1 -0
- package/dist/playground/worker/ruby.js +197 -0
- package/dist/playground/worker/rust.js +206 -8
- package/dist/playground/worker/sqlite.d.ts +1 -0
- package/dist/playground/worker/sqlite.js +104 -0
- package/dist/playground/worker/typescript.d.ts +1 -0
- package/dist/playground/worker/typescript.js +160 -0
- package/dist/playground/worker/wasm.d.ts +1 -0
- package/dist/playground/worker/wasm.js +265 -0
- package/dist/playground/worker/wat.d.ts +1 -0
- package/dist/playground/worker/wat.js +180 -0
- package/dist/playground/worker/zig.d.ts +1 -0
- package/dist/playground/worker/zig.js +376 -0
- package/dist/playground/workerProgress.d.ts +8 -0
- package/dist/playground/workerProgress.js +13 -0
- package/dist/playground/workerSession.d.ts +24 -0
- package/dist/playground/workerSession.js +107 -0
- package/dist/playground/zig.d.ts +28 -0
- package/dist/playground/zig.js +176 -0
- package/package.json +200 -105
- package/dist/clang/app.d.ts +0 -75
- package/dist/clang/app.js +0 -744
- package/dist/clang/apply.d.ts +0 -2
- package/dist/clang/apply.js +0 -11
- package/dist/clang/color.d.ts +0 -3
- package/dist/clang/color.js +0 -3
- package/dist/clang/encode.d.ts +0 -4
- package/dist/clang/encode.js +0 -20
- package/dist/clang/error.d.ts +0 -14
- package/dist/clang/error.js +0 -27
- package/dist/clang/gccCompat.d.ts +0 -15
- package/dist/clang/gccCompat.js +0 -767
- package/dist/clang/index.d.ts +0 -85
- package/dist/clang/index.js +0 -1077
- package/dist/clang/memory/index.d.ts +0 -4
- package/dist/clang/memory/index.js +0 -4
- package/dist/clang/memory/memFs.d.ts +0 -35
- package/dist/clang/memory/memFs.js +0 -132
- package/dist/clang/memory/memory.d.ts +0 -22
- package/dist/clang/memory/memory.js +0 -73
- package/dist/clang/memory/tar.d.ts +0 -2
- package/dist/clang/memory/tar.js +0 -59
- package/dist/clang/url.d.ts +0 -4
- package/dist/clang/url.js +0 -5
- package/dist/clang/wasm.d.ts +0 -4
- package/dist/clang/wasm.js +0 -50
- package/dist/clangd/config.d.ts +0 -18
- package/dist/clangd/config.js +0 -14
- package/dist/clangd/jsonStream.d.ts +0 -9
- package/dist/clangd/jsonStream.js +0 -48
- package/dist/clangd/session.d.ts +0 -18
- package/dist/clangd/session.js +0 -112
- package/dist/clangd/worker.js +0 -131
- package/dist/debug/controller.svelte.d.ts +0 -43
- package/dist/debug/controller.svelte.js +0 -268
- package/dist/debug/editor/index.d.ts +0 -2
- package/dist/debug/editor/index.js +0 -1
- package/dist/debug/editor/monaco.d.ts +0 -26
- package/dist/debug/editor/monaco.js +0 -128
- package/dist/debug/expression.d.ts +0 -26
- package/dist/debug/expression.js +0 -547
- package/dist/debug/index.d.ts +0 -8
- package/dist/debug/index.js +0 -5
- package/dist/debug/language/cpp.d.ts +0 -2
- package/dist/debug/language/cpp.js +0 -7
- package/dist/debug/language/index.d.ts +0 -3
- package/dist/debug/language/index.js +0 -2
- package/dist/debug/language/python.d.ts +0 -2
- package/dist/debug/language/python.js +0 -14
- package/dist/debug/language/types.d.ts +0 -6
- package/dist/debug/locals.d.ts +0 -2
- package/dist/debug/locals.js +0 -8
- package/dist/lsp/cpp/server.d.ts +0 -2
- package/dist/lsp/cpp/server.js +0 -68
- package/dist/lsp/index.d.ts +0 -5
- package/dist/lsp/index.js +0 -4
- package/dist/lsp/python/main.worker.js +0 -92
- package/dist/lsp/python/package/arcturus_python_lsp/__init__.py +0 -3
- package/dist/lsp/python/package/arcturus_python_lsp/server.py +0 -462
- package/dist/lsp/python/server.d.ts +0 -2
- package/dist/lsp/python/server.js +0 -54
- package/dist/lsp/registry.d.ts +0 -2
- package/dist/lsp/registry.js +0 -12
- package/dist/lsp/runtime.d.ts +0 -5
- package/dist/lsp/runtime.js +0 -31
- package/dist/lsp/types.d.ts +0 -17
- package/dist/terminal/Terminal.svelte +0 -422
- package/dist/terminal/Terminal.svelte.d.ts +0 -26
- package/dist/terminal/index.d.ts +0 -7
- package/dist/terminal/index.js +0 -5
- package/dist/terminal/plugin/index.d.ts +0 -9
- package/dist/terminal/plugin/index.js +0 -19
- package/dist/terminal/theme.d.ts +0 -49
- package/dist/terminal/theme.js +0 -49
- package/dist/terminal/types.d.ts +0 -18
- package/dist/utils/vscodeJsonrpcBrowser.d.ts +0 -5
- package/dist/utils/vscodeJsonrpcBrowser.js +0 -4
- /package/dist/{clangd/worker.d.ts → playground/worker/assemblyscript.d.ts} +0 -0
- /package/dist/{debug/language/types.js → playground/worker/cobol.d.ts} +0 -0
- /package/dist/{lsp/python/main.worker.d.ts → playground/worker/d.d.ts} +0 -0
- /package/dist/{lsp/types.js → playground/worker/dotnet.d.ts} +0 -0
- /package/dist/{terminal/types.js → playground/worker/duckdb.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -2,49 +2,318 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
Executes C++, Python, Java, Rust,
|
|
5
|
+
Executes C, C++, Python, Java, Rust, Go, D, C#, F#, VB.NET, Elixir, Erlang, Prolog,
|
|
6
|
+
Gleam, Perl, Tcl, AWK, Pascal, Forth, J, BQN, Janet, Julia, Nim, Bash, ClojureScript, TinyGo, OCaml, JavaScript, TypeScript,
|
|
7
|
+
AssemblyScript, WAT, WASM, Lua, Zig, Scheme, Ruby, Haskell, R, Octave, SQLite, DuckDB,
|
|
8
|
+
and PHP code.
|
|
6
9
|
|
|
7
10
|
Refer to src/lib/clang.
|
|
8
11
|
|
|
12
|
+
## Language support policy
|
|
13
|
+
|
|
14
|
+
wasm-idle language support must run user code through the real language implementation in the
|
|
15
|
+
browser, normally via a WebAssembly compiler, interpreter, or runtime. Do not add handwritten
|
|
16
|
+
parsers, translators, emulators, or "subset" executors as language support. A language should be
|
|
17
|
+
listed only after normal user code runs on that actual runtime and stdin/stdout behavior, or a
|
|
18
|
+
documented stdin limitation, is covered by tests.
|
|
19
|
+
|
|
20
|
+
## Support matrix
|
|
21
|
+
|
|
22
|
+
All execution entries run in the browser through real runtime, compiler, or interpreter
|
|
23
|
+
implementations. `Editor support` lists browser LSP/compiler diagnostics when wired; `syntax`
|
|
24
|
+
means Monaco syntax highlighting only. `Debug` means wasm-idle's trace/debug controls, not a
|
|
25
|
+
native debugger.
|
|
26
|
+
|
|
27
|
+
| Language | Browser runtime/compiler | Stdin | Editor support | Debug |
|
|
28
|
+
| -------------- | --------------------------------------- | ----- | -------------------- | ----- |
|
|
29
|
+
| C | @wasm-idle/llvm-core / Clang WASI | Yes | clangd | Trace |
|
|
30
|
+
| C++ | @wasm-idle/llvm-core / Clang WASI | Yes | clangd | Trace |
|
|
31
|
+
| Objective-C | GNUstep libobjc2 + @wasm-idle/llvm-core | Yes | clangd | Trace |
|
|
32
|
+
| Python | Pyodide | Yes | Python LSP | Trace |
|
|
33
|
+
| Java | TeaVM | Yes | syntax | - |
|
|
34
|
+
| Rust | wasm-rust / browser rustc | Yes | rustc diagnostics | Trace |
|
|
35
|
+
| Go | wasm-go / browser Go compiler | Yes | compiler diagnostics | Trace |
|
|
36
|
+
| D | wasm-d | Yes | syntax | - |
|
|
37
|
+
| C# | wasm-dotnet | Yes | compiler diagnostics | - |
|
|
38
|
+
| F# | wasm-dotnet | Yes | compiler diagnostics | - |
|
|
39
|
+
| VB.NET | wasm-dotnet | Yes | compiler diagnostics | - |
|
|
40
|
+
| Elixir | AtomVM / Popcorn | Yes | syntax | - |
|
|
41
|
+
| Erlang | AtomVM / Popcorn | Yes | syntax | - |
|
|
42
|
+
| Prolog | SWI-Prolog WASM worker | Yes | syntax | - |
|
|
43
|
+
| Gleam | Gleam precompiled browser runtime | Yes | compiler diagnostics | - |
|
|
44
|
+
| Perl | Perl WASM worker | Yes | syntax | - |
|
|
45
|
+
| Tcl | Wacl Tcl WASM worker | Yes | syntax | - |
|
|
46
|
+
| AWK | GoAWK WASM worker | Yes | syntax | - |
|
|
47
|
+
| Pascal | pas2js worker | Yes | syntax | - |
|
|
48
|
+
| Forth | WAForth WASM worker | Yes | syntax | - |
|
|
49
|
+
| J | J playground WASM worker | Yes | syntax | - |
|
|
50
|
+
| BQN | CBQN WASM worker | Yes | syntax | - |
|
|
51
|
+
| Janet | Janet VM WASM worker | Yes | syntax | - |
|
|
52
|
+
| Julia | Julia 1.0.4 WASM worker | Yes | syntax | - |
|
|
53
|
+
| Nim | Nim 2.2.4 WASM + clang/lld WASM | Yes | syntax | - |
|
|
54
|
+
| Bash | GNU Bash WASIX / Wasmer SDK | Yes | syntax | - |
|
|
55
|
+
| ClojureScript | cljs.js self-hosted compiler | Yes | syntax | - |
|
|
56
|
+
| TinyGo | wasm-tinygo | Yes | syntax | - |
|
|
57
|
+
| OCaml | wasm-of-js-of-ocaml / js_of_ocaml | Yes | syntax | - |
|
|
58
|
+
| JavaScript | wasm-typescript / TypeScript service | Yes | TypeScript LSP | - |
|
|
59
|
+
| TypeScript | wasm-typescript / TypeScript service | Yes | TypeScript LSP | - |
|
|
60
|
+
| AssemblyScript | AssemblyScript compiler | Yes | AssemblyScript LSP | - |
|
|
61
|
+
| WAT | WABT | Yes | WAT LSP | - |
|
|
62
|
+
| WASM | Browser WebAssembly + WASI shim | Yes | syntax | - |
|
|
63
|
+
| Lua | Wasmoon | Yes | syntax | - |
|
|
64
|
+
| Zig | zig_small.wasm | Yes | syntax | - |
|
|
65
|
+
| Scheme | Puppy Scheme / wasm-lisp | Yes | syntax | - |
|
|
66
|
+
| Ruby | CRuby WASI | Yes | syntax | - |
|
|
67
|
+
| Haskell | ghc-in-browser | Yes | syntax | - |
|
|
68
|
+
| Fortran | f2c + @wasm-idle/llvm-core | Yes | Fortran LSP | - |
|
|
69
|
+
| COBOL | GnuCOBOL 3.2 + @wasm-idle/llvm-core | Yes | syntax | - |
|
|
70
|
+
| R | WebR | Yes | syntax | - |
|
|
71
|
+
| Octave | wasm-octave | Yes | syntax | - |
|
|
72
|
+
| DuckDB | DuckDB-Wasm | Files | DuckDB LSP | - |
|
|
73
|
+
| SQLite | sql.js | n/a | syntax | - |
|
|
74
|
+
| PHP | PHP 8.4 / php-wasm | Yes | syntax | - |
|
|
75
|
+
|
|
76
|
+
### Runtime details
|
|
77
|
+
|
|
78
|
+
`Package/version base` names the deployed static module or manifest and its producer package,
|
|
79
|
+
or the browser-side package/workspace runtime that backs each row. Static ESM entries are page
|
|
80
|
+
assets loaded over HTTP on demand, not files embedded in the published npm packages.
|
|
81
|
+
`Execution defaults / flags` lists the default
|
|
82
|
+
targets and flags wasm-idle applies, plus the public per-run options that change execution.
|
|
83
|
+
`Customization` lists the `runtimeAssets` fields and matching `PUBLIC_WASM_*` env overrides
|
|
84
|
+
when they exist.
|
|
85
|
+
|
|
86
|
+
| Language / IDs | Package/version base | Execution defaults / flags | Customization |
|
|
87
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
88
|
+
| C<br>`C` | @wasm-idle/llvm-core@1.0.0-next.0 / Clang 22.1.8 WASI sysroot from the `wasm-llvm` producer | `clang` for `wasm32-wasi`; default `-std=gnu11`; native gzip delivery for compiler Wasm and sysroot tar assets; trace debug uses wasm-idle controls; WASI preview1 execution supports `stdin` and `programArgs` | `runtimeAssets.clang.baseUrl`/`loader` or `rootUrl`; `compileArgs`, `programArgs`, `cVersion`, `activePath`, `workspaceFiles`, `debug`, `breakpoints`, `pauseOnEntry` |
|
|
89
|
+
| C++<br>`CPP` | @wasm-idle/llvm-core@1.0.0-next.0 / Clang 22.1.8 WASI sysroot from the `wasm-llvm` producer | `clang++` for `wasm32-wasi`; default `-std=gnu++2a`; native gzip delivery for compiler Wasm and sysroot tar assets; trace debug uses wasm-idle controls; supports `stdin` and `programArgs` | `runtimeAssets.clang.baseUrl`/`loader` or `rootUrl`; `compileArgs`, `programArgs`, `cppVersion`, `activePath`, `workspaceFiles`, `debug`, `breakpoints`, `pauseOnEntry` |
|
|
90
|
+
| Objective-C<br>`OBJC` | GNUstep libobjc2 v2.3 assets from the `wasm-llvm` producer + @wasm-idle/llvm-core@1.0.0-next.0 | `clang -x objective-c -fobjc-runtime=gnustep-2.0 -fblocks` for `wasm32-wasi`; links `libobjc.a`, `libgnustep-base.a`, and `libffi.a` when Foundation is imported; Foundation headers are inlined from `foundation-headers.json`; includes a constructor wrapper for Objective-C class registration; auto-compiles `.m` and `.c` workspace sources; trace debug instruments active source and uses wasm-idle controls; supports `stdin` and `programArgs`; large Objective-C assets may be served as gzip-only `.gz` files through the service worker or worker fallback | `runtimeAssets.objectivec.baseUrl`/`libobjcUrl`/`headersUrl`/`libgnustepBaseUrl`/`libgnustepBaseObjectUrl`/`foundationHeadersUrl`/`libffiUrl` or `PUBLIC_WASM_OBJECTIVEC_*`; `runtimeAssets.clang.baseUrl`/`loader` for the clang toolchain; `activePath`, `workspaceFiles`, `compileArgs`, `debug`, `breakpoints`, `pauseOnEntry` |
|
|
91
|
+
| Python<br>`PYTHON3`, `PYPY3` | static ESM `static/pyodide/pyodide.mjs` / pyodide@0.29.3 | loads `pyodide.mjs`, `pyodide.asm.js`, `pyodide.asm.wasm`, and `python_stdlib.zip` from the configured static asset tree on demand; supports `stdin`, workspace files, and trace debugging | `runtimeAssets.python.baseUrl`/`loader` or `rootUrl`; `stdin`, `activePath`, `workspaceFiles`, `debug`, `breakpoints`, `pauseOnEntry`, `debugPath` |
|
|
92
|
+
| Java<br>`JAVA` | @wasm-idle/runtime-teavm@0.0.0 / TeaVM compiler assets | `compiler.wasm` compiles Java to browser WASM/JS; supports `stdin` and `programArgs` | `runtimeAssets.java.baseUrl`/`loader` or `rootUrl` |
|
|
93
|
+
| Rust<br>`RUST` | wasm-rust@0.1.0 / rust-1.99.0-browser-integrated-v1 + integrated LLVM/LLD 22.1.8 from the `wasm-llvm` producer; `debug-instrumenter.js` is a separately generated static asset | browser host `wasm32-wasip1-threads`; `rustc -Zthreads=1 -Zcodegen-backend=llvm --crate-type=bin --edition=2024 -Cpanic=abort -Ccodegen-units=1 --emit=link`; default target `wasm32-wasip1`, selectable `wasm32-wasip1`, `wasm32-wasip2`, `wasm32-wasip3`; Preview 1 emits core Wasm and Preview 2/3 are component-encoded; supports `stdin` and `programArgs`; the debug instrumenter is fetched only for debug runs | `runtimeAssets.rust.compilerUrl`, `runtimeAssets.rust.debugModuleUrl`, or `PUBLIC_WASM_RUST_COMPILER_URL`; `rootUrl`, `rustTargetTriple`, `programArgs`; compiler requests accept `edition`, `crateType`, `extendedTimeout`, `log`, and `onProgress`; runtime manifest controls compiler memory, timeout, and shared workspace size |
|
|
94
|
+
| Go<br>`GO` | wasm-go@0.1.0 / go1.26.1 | default target `wasip1/wasm`; selectable `wasip1/wasm`, `wasip2/wasm`, `wasip3/wasm`, `js/wasm`; supports `stdin` and `programArgs` | `runtimeAssets.go.compilerUrl` or `PUBLIC_WASM_GO_COMPILER_URL`; `goTarget`, `programArgs` |
|
|
95
|
+
| D<br>`D` | wasm-d@0.1.0 / ldc-1.42.0-wasi-smoke | `ldc2 -conf=/toolchain/etc/ldc2.conf -mtriple=wasm32-wasi -c` then `wasm-ld` to WASI preview1; supports `stdin` and `programArgs` | `runtimeAssets.d.moduleUrl` or `PUBLIC_WASM_D_MODULE_URL`; `activePath`, `programArgs` |
|
|
96
|
+
| C#<br>`CSHARP` | wasm-dotnet@0.1.0 / .NET 9.0.16 browser-wasm / Roslyn C# 4.14.0 | `CSharpCompilationOptions(OutputKind.ConsoleApplication)`; `concurrentBuild=false`; target `browser-wasm`; language-specific AOT bundle `runtime/csharp/`; supports `stdin` and `programArgs` | `runtimeAssets.dotnet.moduleUrl` or `PUBLIC_WASM_DOTNET_MODULE_URL`; `programArgs`, LSP on/off |
|
|
97
|
+
| F#<br>`FSHARP` | wasm-dotnet@0.1.0 / .NET 9.0.16 browser-wasm / FCS 43.12.204 / FSharp.Core 10.1.204 | `fsc.exe --target:exe --targetprofile:netcore --noframework --simpleresolution --nowin32manifest --debug- --optimize-`; language-specific AOT bundle `runtime/fsharp/`; supports `stdin` and `programArgs` | `runtimeAssets.dotnet.moduleUrl` or `PUBLIC_WASM_DOTNET_MODULE_URL`; `programArgs`, LSP on/off |
|
|
98
|
+
| VB.NET<br>`VBNET` | wasm-dotnet@0.1.0 / .NET 9.0.16 browser-wasm / Roslyn Visual Basic 4.14.0 | `VisualBasicCompilationOptions(OutputKind.ConsoleApplication)`; `concurrentBuild=false`, `OptionStrict=Off`, `OptionInfer=On`, `OptionExplicit=On`; target `browser-wasm`; language-specific AOT bundle `runtime/vbnet/`; supports `stdin` and `programArgs` | `runtimeAssets.dotnet.moduleUrl` or `PUBLIC_WASM_DOTNET_MODULE_URL`; `programArgs`, LSP on/off |
|
|
99
|
+
| Elixir<br>`ELIXIR` | wasm-elixir asset bundle / @swmansion/popcorn@0.2.2 | Popcorn/AtomVM bundle `bundle.avm`; supports `stdin` | `runtimeAssets.elixir.bundleUrl` or `PUBLIC_WASM_ELIXIR_BUNDLE_URL` |
|
|
100
|
+
| Erlang<br>`ERLANG` | wasm-elixir asset bundle / @swmansion/popcorn@0.2.2 | Popcorn/AtomVM bundle `bundle.avm`; supports `stdin` | `runtimeAssets.erlang.bundleUrl` or `PUBLIC_WASM_ERLANG_BUNDLE_URL`; falls back to Elixir bundle URL |
|
|
101
|
+
| Prolog<br>`PROLOG` | swipl-wasm@8.0.1 synced into `static/wasm-prolog` | static worker runs SWI-Prolog; supports `stdin` and `programArgs` | `runtimeAssets.prolog.baseUrl`/`runtimeAssets.prolog.workerUrl` or `PUBLIC_WASM_PROLOG_BASE_URL`/`PUBLIC_WASM_PROLOG_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
102
|
+
| Gleam<br>`GLEAM` | @live-codes/gleam-precompiled@0.5.0 static worker | Gleam worker compiles/runs browser output with source manifest; supports `stdin` | `runtimeAssets.gleam.baseUrl`/`workerUrl`/`manifestUrl` or `PUBLIC_WASM_GLEAM_*`; `programArgs`, `workspaceFiles` |
|
|
103
|
+
| Perl<br>`PERL` | WebPerl v0.09-beta (webperl_prebuilt_v0.09-beta.zip) | static worker runs `emperl`; supports `stdin` and `programArgs` | `runtimeAssets.perl.baseUrl`/`runtimeAssets.perl.workerUrl` or `PUBLIC_WASM_PERL_BASE_URL`/`PUBLIC_WASM_PERL_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
104
|
+
| Tcl<br>`TCL` | Wacl Tcl 2017-05-29 (wacl.zip) | static worker runs Wacl Tcl; supports `stdin` and `programArgs` | `runtimeAssets.tcl.baseUrl`/`runtimeAssets.tcl.workerUrl` or `PUBLIC_WASM_TCL_BASE_URL`/`PUBLIC_WASM_TCL_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
105
|
+
| AWK<br>`AWK` | GoAWK v1.31.0 / go1.25.3 | static worker runs `goawk.wasm`; supports `stdin` and `programArgs` | `runtimeAssets.awk.baseUrl`/`runtimeAssets.awk.workerUrl` or `PUBLIC_WASM_AWK_BASE_URL`/`PUBLIC_WASM_AWK_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
106
|
+
| Pascal<br>`PASCAL` | pas2js 3.2.1 (9ac46614dc82) | static worker compiles with pas2js then runs JS; supports `stdin` | `runtimeAssets.pascal.baseUrl`/`runtimeAssets.pascal.workerUrl` or `PUBLIC_WASM_PASCAL_BASE_URL`/`PUBLIC_WASM_PASCAL_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
107
|
+
| Forth<br>`FORTH` | waforth@0.20.1 / static worker | WAForth worker; supports `stdin` and `programArgs` | `runtimeAssets.forth.baseUrl`/`runtimeAssets.forth.workerUrl` or `PUBLIC_WASM_FORTH_BASE_URL`/`PUBLIC_WASM_FORTH_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
108
|
+
| J<br>`J` | jsoftware-j-playground static worker | J playground worker; supports `stdin` and `programArgs` | `runtimeAssets.j.baseUrl`/`runtimeAssets.j.workerUrl` or `PUBLIC_WASM_J_BASE_URL`/`PUBLIC_WASM_J_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
109
|
+
| BQN<br>`BQN` | CBQN static worker / Emscripten 3.1.8 | CBQN worker; supports `stdin` and `programArgs` | `runtimeAssets.bqn.baseUrl`/`runtimeAssets.bqn.workerUrl` or `PUBLIC_WASM_BQN_BASE_URL`/`PUBLIC_WASM_BQN_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
110
|
+
| Janet<br>`JANET` | Janet static worker / Emscripten 3.1.8 | Janet VM worker; supports `stdin` and `programArgs` | `runtimeAssets.janet.baseUrl`/`runtimeAssets.janet.workerUrl` or `PUBLIC_WASM_JANET_BASE_URL`/`PUBLIC_WASM_JANET_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
111
|
+
| Julia<br>`JULIA` | @chriskoch/julia-wasm@1.0.4 | Julia WASM worker; supports `stdin` and `programArgs` | `runtimeAssets.julia.baseUrl`/`runtimeAssets.julia.workerUrl` or `PUBLIC_WASM_JULIA_BASE_URL`/`PUBLIC_WASM_JULIA_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
112
|
+
| Nim<br>`NIM` | Nim 2.2.4 / benagastov Nim-WASM-Compiler with clang/lld WASM | static worker compiles Nim to C, then clang/lld to WASM; supports `stdin` | `runtimeAssets.nim.baseUrl`/`runtimeAssets.nim.workerUrl` or `PUBLIC_WASM_NIM_BASE_URL`/`PUBLIC_WASM_NIM_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
113
|
+
| Bash<br>`BASH` | @wasm-idle/runtime-bash@0.1.0 / GNU Bash WASIX + static ESM `static/wasm-bash/sdk/index.mjs` produced from @wasmer/sdk@0.9.0 | runs the pinned `bash.webc` locally through the on-demand Wasmer SDK asset; invokes `bash -c <code> <activePath> ...programArgs` and supports `stdin`, `programArgs`, `activePath`, and `workspaceFiles` | `runtimeAssets.bash.moduleUrl`/`workerUrl`/`webcUrl` or `rootUrl`; `stdin`, `programArgs`, `activePath`, `workspaceFiles` |
|
|
114
|
+
| ClojureScript<br>`CLOJURESCRIPT` | @wasm-idle/runtime-clojurescript@0.1.0 / ClojureScript 1.12.134 | static worker compiles and evaluates with the official `cljs.js` self-hosted compiler; supports `stdin`, `programArgs`, `activePath`, and `workspaceFiles` | `runtimeAssets.clojurescript.baseUrl`/`runtimeAssets.clojurescript.workerUrl` or `PUBLIC_WASM_CLOJURESCRIPT_BASE_URL`/`PUBLIC_WASM_CLOJURESCRIPT_WORKER_URL`; `programArgs`, `activePath`, `workspaceFiles` |
|
|
115
|
+
| TinyGo<br>`TINYGO` | wasm-tinygo@0.0.0 / TinyGo 0.40.1 browser toolchain | default target `wasm`; selectable `wasm`, `wasip1`, `wasip2`, `wasip3`; supports `stdin` and `programArgs` | `runtimeAssets.tinygo.moduleUrl`/`appUrl`/`assetLoader`/`assetPacks`; `PUBLIC_WASM_TINYGO_*`, `tinygoTarget`, `programArgs` |
|
|
116
|
+
| OCaml<br>`OCAML` | wasm-of-js-of-ocaml@0.1.0 / js_of_ocaml + wasm_of_ocaml | default backend `wasm`; selectable `wasm`, `js`; `ocamlWasmBinaryenMode` `fast`, `full`; supports `stdin` | `runtimeAssets.ocaml.moduleUrl`/`manifestUrl` or `PUBLIC_WASM_OCAML_*`; `ocamlBackend` |
|
|
117
|
+
| JavaScript<br>`JAVASCRIPT` | wasm-typescript@0.1.0 / @swc/wasm-typescript@1.15.33 | TypeScript service transpiles JS/TS and runs in browser sandbox; supports `stdin` and `programArgs` | `runtimeAssets.typescript.moduleUrl`/`libUrl` or `PUBLIC_WASM_TYPESCRIPT_MODULE_URL` |
|
|
118
|
+
| TypeScript<br>`TYPESCRIPT` | wasm-typescript@0.1.0 / @swc/wasm-typescript@1.15.33 | TypeScript service transpiles then runs in browser sandbox; supports `stdin` and `programArgs` | `runtimeAssets.typescript.moduleUrl`/`libUrl` or `PUBLIC_WASM_TYPESCRIPT_MODULE_URL` |
|
|
119
|
+
| AssemblyScript<br>`ASSEMBLYSCRIPT` | static ESM `static/wasm-assemblyscript/runtime.mjs` produced from assemblyscript@0.28.17 + @assemblyscript/loader@0.28.17 | `asc <activePath> --outFile module.wasm --runtime incremental --bindings raw --optimize --exportRuntime`; runs the emitted WASM through WASI/browser imports and supports `stdin` | `runtimeAssets.assemblyscript.moduleUrl` or `PUBLIC_WASM_ASSEMBLYSCRIPT_MODULE_URL` or `rootUrl`; `stdin`, `activePath`, `workspaceFiles` |
|
|
120
|
+
| WAT<br>`WAT` | wasm-wat@0.1.0 / wabt@1.0.39 | WABT parses WAT to WASM then runs through WASI shim; supports `stdin` and `programArgs` | `runtimeAssets.wat.moduleUrl` or `PUBLIC_WASM_WAT_MODULE_URL`; `programArgs` |
|
|
121
|
+
| WASM<br>`WASM` | Browser WebAssembly + @bjorn3/browser_wasi_shim@0.4.2 | loads provided WASM bytes and executes with WASI preview1 imports; supports `stdin` and `programArgs` | `programArgs`, `stdin`, `activePath` |
|
|
122
|
+
| Lua<br>`LUA` | wasm-lua@0.1.0 / wasmoon@1.16.0 | Wasmoon Lua VM; supports `stdin` and `programArgs` | `runtimeAssets.lua.moduleUrl` or `PUBLIC_WASM_LUA_MODULE_URL`; `programArgs` |
|
|
123
|
+
| Zig<br>`ZIG` | static wasm-zig assets / `zig_small.wasm` + `std.tar.gz` | native gzip delivery for the tar standard library; default target `wasm64-wasi`; Zig compile args are appended; supports `stdin`, `compileArgs`, `programArgs` | `runtimeAssets.zig.compilerUrl`/`stdlibUrl` or `PUBLIC_WASM_ZIG_*`; `zigTargetTriple`, `activePath`, `workspaceFiles` |
|
|
124
|
+
| Scheme<br>`LISP` | wasm-lisp@0.1.0 / Puppy Scheme WASM component | Puppy Scheme compiler/runtime; supports `stdin` and `programArgs` | `runtimeAssets.lisp.moduleUrl` or `PUBLIC_WASM_LISP_MODULE_URL`; `programArgs` |
|
|
125
|
+
| Ruby<br>`RUBY` | static ESM `static/wasm-ruby/runtime.mjs` produced from @ruby/3.4-wasm-wasi@2.9.3-2.9.4 + @ruby/wasm-wasi@2.9.3-2.9.4 | CRuby 3.4 WASI runtime loads `ruby+stdlib.wasm` on demand; supports `stdin`, `programArgs`, and workspace files | `runtimeAssets.ruby.moduleUrl`/`wasmUrl` or `PUBLIC_WASM_RUBY_MODULE_URL`/`PUBLIC_WASM_RUBY_WASM_URL` or `rootUrl`; `stdin`, `programArgs`, `workspaceFiles` |
|
|
126
|
+
| Haskell<br>`HASKELL` | ghc-in-browser / GHC 9.14.0.20251031 WASI rootfs | loads `dyld.mjs`, `rootfs.tar.zst`, `bsdtar.wasm`; `compileArgs` become GHC args, otherwise legacy `args` become GHC args | `runtimeAssets.haskell.moduleUrl`/`rootfsUrl`/`bsdtarUrl`; `mainSoPath`, `searchDirs`, `activePath`, `workspaceFiles` |
|
|
127
|
+
| Fortran<br>`FORTRAN` | Netlib f2c 2022-09-09 + `@cowasm/f2c 1.0.0` libf2c + @wasm-idle/llvm-core@1.0.0-next.0 | runs `f2c.wasm` in WASI, compiles generated C with the llvm-core Clang host, links `libf2c.a`, then executes the resulting WASI module with `stdin` and `programArgs` | `runtimeAssets.fortran.baseUrl`/`f2cWasmUrl`/`libf2cUrl`/`f2cHeaderUrl`/`analyzerUrl` or `PUBLIC_WASM_FORTRAN_*`; `runtimeAssets.clang.baseUrl`/`loader` for the C backend; `activePath`, `workspaceFiles`, `compileArgs` |
|
|
128
|
+
| COBOL<br>`COBOL` | GnuCOBOL 3.2 + GMP 6.3.0 assets from the `wasm-llvm` producer + @wasm-idle/llvm-core@1.0.0-next.0 | native gzip delivery for the frontend Wasm and filesystem tar assets; translates free-format COBOL with the real GnuCOBOL `cobc` frontend, compiles the generated C with the llvm-core Clang host, links libcob/GMP, and executes the resulting WASI module with `stdin` and `programArgs` | `runtimeAssets.cobol.baseUrl` or `PUBLIC_WASM_COBOL_BASE_URL`; `runtimeAssets.clang.baseUrl`/`loader` for the C backend; `activePath`, `workspaceFiles`, `compileArgs` |
|
|
129
|
+
| R<br>`R` | versioned static `static/webr/<hash>/webr.js` / webr@0.6.0 | loads the browser ESM entry `webr.js` and its WebR runtime files from the configured static asset tree on demand; supports `stdin`, `programArgs`, and workspace files | `runtimeAssets.r.baseUrl` or `PUBLIC_WASM_R_BASE_URL`; `stdin`, `programArgs`, `activePath`, `workspaceFiles` |
|
|
130
|
+
| Octave<br>`OCTAVE` | Octave 10.3.0 (octave-10.3.0-pl5321h996e327_3.tar.bz2) | Octave CLI Emscripten worker; supports `stdin` and `programArgs` | `runtimeAssets.octave.baseUrl`/`workerUrl`/`manifestUrl` or `PUBLIC_WASM_OCTAVE_*` |
|
|
131
|
+
| DuckDB<br>`DUCKDB` | static ESM `static/wasm-duckdb/runtime.mjs` produced from @duckdb/duckdb-wasm@1.33.1-dev45.0 | selects the best DuckDB-Wasm MVP/EH bundle on demand and creates a fresh in-memory database per run; `stdin` is registered as `stdin.txt` and `/dev/stdin` rather than terminal stdin | `runtimeAssets.duckdb.moduleUrl` or `PUBLIC_WASM_DUCKDB_MODULE_URL` or `rootUrl`; `stdin`, `activePath`, `workspaceFiles` |
|
|
132
|
+
| SQLite<br>`SQLITE` | static ESM `static/wasm-sqlite/runtime.mjs` produced from sql.js@1.14.1 | sql.js loads `sql-wasm.wasm` on demand and executes SQL in a fresh in-memory database; terminal stdin is not applicable | `runtimeAssets.sqlite.moduleUrl`/`wasmUrl` or `PUBLIC_WASM_SQLITE_MODULE_URL`/`PUBLIC_WASM_SQLITE_WASM_URL` or `rootUrl`; `workspaceFiles` |
|
|
133
|
+
| PHP<br>`PHP` | static ESM `static/wasm-php/runtime.mjs` prebuilt by the standalone `producers/wasm-php` producer from @php-wasm/web-8-4@3.1.34 + @php-wasm/universal@3.1.34 | fixed PHP `8.4` php-wasm runtime; injects `$argv`/`$argc` and runs the active workspace script with `php.run`; supports `stdin` and `programArgs`; there is no runtime version selector | `runtimeAssets.php.moduleUrl` or `PUBLIC_WASM_PHP_MODULE_URL` or `rootUrl`; `stdin`, `programArgs`, `activePath`, `workspaceFiles` |
|
|
134
|
+
|
|
135
|
+
### Blocked candidates
|
|
136
|
+
|
|
137
|
+
These languages are intentionally not part of the execution support matrix yet. They should stay
|
|
138
|
+
out of `supportedLanguages` until the blocker is resolved with a real browser runtime/compiler and
|
|
139
|
+
stdin/stdout coverage.
|
|
140
|
+
|
|
141
|
+
| Candidate | Candidate IDs | Current evidence | Blocker | Required follow-up |
|
|
142
|
+
| -------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
143
|
+
| Modern Fortran | `F90`, `F95` | `FORTRAN` now runs through f2c/libf2c, while `static/wasm-fortran` still packages LFortran analyzer assets | LFortran WASM/WAT stdin codegen still aborts and the C backend reports `visit_FileRead() not implemented`; f2c covers Fortran 77-style code but is not a full modern Fortran compiler | Package a real browser modern Fortran compiler/runtime with stdin-capable codegen before advertising F90/F95 as first-class runtimes |
|
|
144
|
+
| Crystal | `CRYSTAL` | No browser Crystal compiler/runtime assets are packaged in this repository | Crystal cannot be treated as syntax-only or as a wasm-idle-authored translator/subset | Find or build a browser-hosted real Crystal compiler/runtime path with stdin/stdout coverage before registering the language |
|
|
145
|
+
| Swift | `SWIFT` | Swift.org documents Wasm support through a native Swift 6.x toolchain plus a Wasm SDK, and SwiftWasm Pad uses a backend compile service; no browser-hosted swiftc/SwiftPM runtime asset is packaged here | Swift cannot be implemented as a wasm-idle-authored parser/runtime subset or as a remote compile service; the playground needs a redistributable browser-hosted real Swift compiler path | Build or source a browser-hosted Swift compiler/SwiftPM runtime bundle, prove stdin/stdout execution for generated WASI modules, then register SWIFT as a first-class runtime |
|
|
146
|
+
|
|
147
|
+
## Monorepo layout
|
|
148
|
+
|
|
149
|
+
`wasm-idle` is managed as a pnpm workspace. Language-independent app code remains here while large
|
|
150
|
+
toolchains can be consumed from pinned external runtime repositories:
|
|
151
|
+
|
|
152
|
+
- `packages/core`: framework-neutral contracts, runtime asset keys, progress helpers, and playground
|
|
153
|
+
binding helpers.
|
|
154
|
+
- `packages/debug`: optional debug session controller, language adapters, expression helpers, and
|
|
155
|
+
Monaco integration built on the contracts from `@wasm-idle/core`.
|
|
156
|
+
- `packages/llvm-core`: code-only browser hosts for shared memory, MemFS, tar, WASI, Clang, COBOL,
|
|
157
|
+
and Objective-C execution. Every compiler, sysroot, archive, and worker asset is supplied through
|
|
158
|
+
an explicit HTTP(S) URL.
|
|
159
|
+
- `packages/lsp`: code-only browser language-server hosts. TypeScript libraries, SQL engines,
|
|
160
|
+
clangd, and other language-tool assets are supplied through explicit runtime URLs.
|
|
161
|
+
- `wasm-llvm`: external producer repository for compiler source pins, patches, reproducible builds,
|
|
162
|
+
manifests, and asset verification. Its `producer/rust-browser` source build owns the current Rust
|
|
163
|
+
1.99 compiler, matching LLVM 22 code generator, and in-process LLD; it is not consumed as an npm
|
|
164
|
+
runtime package.
|
|
165
|
+
- `packages/svelte`: Svelte store/binding helpers around `@wasm-idle/core`.
|
|
166
|
+
- `packages/terminal`: optional Svelte/xterm terminal UI that consumes an injected playground
|
|
167
|
+
binding without adding browser UI dependencies to the root runtime package.
|
|
168
|
+
- `packages/react`: React hooks around `@wasm-idle/core`.
|
|
169
|
+
- `packages/vue`: Vue composables around `@wasm-idle/core`.
|
|
170
|
+
- `packages/node`: Node.js host helpers for Node-capable sandbox loaders.
|
|
171
|
+
- `runtimes/*`: imported runtime/compiler packages such as `wasm-rust`,
|
|
172
|
+
`wasm-of-js-of-ocaml`, `wasm-go`, `wasm-tinygo`, `wasm-dotnet`, `wasm-typescript`,
|
|
173
|
+
`wasm-wat`, `wasm-lua`, `wasm-lisp`, `wasm-elixir`, `wasm-tcl`, `wasm-awk`,
|
|
174
|
+
`wasm-forth`, `wasm-j`, `wasm-bqn`, `wasm-janet`,
|
|
175
|
+
`pyodide`, `teavm`, `assemblyscript`, `ruby`, `r`, and `js-sandbox`.
|
|
176
|
+
- `producers/wasm-php`: standalone, locked producer for the checked-in PHP 8.4 page asset. It is
|
|
177
|
+
outside the root workspace and is never published as an npm package.
|
|
178
|
+
- `static/wasm-zig`, `static/wasm-haskell`, `static/wasm-julia`, and `static/wasm-nim`: bundled browser runtime and
|
|
179
|
+
compiler assets synced from
|
|
180
|
+
upstream asset builds rather than local workspace packages.
|
|
181
|
+
- `tools/*`: migrated local toolchain projects that are too broad or infrastructure-heavy to run as
|
|
182
|
+
normal runtime workspace packages. `tools/dool` contains the Docker judge backend for Elixir and
|
|
183
|
+
the other server-side language runners.
|
|
184
|
+
|
|
185
|
+
Useful workspace commands:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
pnpm workspace:list
|
|
189
|
+
pnpm build:packages
|
|
190
|
+
pnpm check:packages
|
|
191
|
+
pnpm build:runtimes
|
|
192
|
+
pnpm check:runtimes
|
|
193
|
+
pnpm sync:runtime list
|
|
194
|
+
pnpm sync:runtimes
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The runtime sync scripts default to `runtimes/<name>/dist`; optional source and target arguments are
|
|
198
|
+
for alternate build directories inside the current checkout. PHP is the exception:
|
|
199
|
+
`sync:wasm-php` consumes `producers/wasm-php/dist` or `WASM_IDLE_WASM_PHP_DIST`.
|
|
200
|
+
|
|
201
|
+
Published packages are built in workspace dependency order. Before publishing, run:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
pnpm verify:package
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
The smoke check packs the root library and its public workspace dependencies, installs the tarballs
|
|
208
|
+
into a temporary project, and imports each public entry point.
|
|
209
|
+
|
|
210
|
+
Package-backed browser runtimes are converted into page-owned static ESM assets with:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
pnpm run build:static-runtime-modules
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
This producer step writes `runtime.mjs` trees under `static/wasm-assemblyscript/`,
|
|
217
|
+
`static/wasm-duckdb/`, `static/wasm-ruby/`, and `static/wasm-sqlite/`. It also writes the Wasmer SDK
|
|
218
|
+
module, worker, and WASM payload under `static/wasm-bash/sdk/`. The browser loads each module on
|
|
219
|
+
demand when its language is selected; these files are deployed page assets, not npm package
|
|
220
|
+
contents.
|
|
221
|
+
|
|
222
|
+
PHP is built independently under `producers/wasm-php`, with its own lockfile and exact
|
|
223
|
+
`@php-wasm/web-8-4@3.1.34` and `@php-wasm/universal@3.1.34` dependencies. Refresh the checked-in
|
|
224
|
+
page asset only when changing that producer:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
pnpm --dir producers/wasm-php install --frozen-lockfile
|
|
228
|
+
pnpm --dir producers/wasm-php build
|
|
229
|
+
pnpm --dir producers/wasm-php verify
|
|
230
|
+
pnpm run sync:wasm-php
|
|
231
|
+
pnpm run build:static-runtime-modules
|
|
232
|
+
pnpm run compress:static-runtimes
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
`build:static-runtime-modules` regenerates the shared module cache key after the PHP manifest
|
|
236
|
+
changes, but validates rather than rebuilds PHP. `page:build` neither installs nor bundles PHP
|
|
237
|
+
packages; it validates the manifest, logical byte sizes, and SHA-256 hashes of the checked-in
|
|
238
|
+
`static/wasm-php/` output before consuming it. The runtime exposes PHP 8.4 only; there is no runtime
|
|
239
|
+
PHP version selector.
|
|
240
|
+
|
|
9
241
|
Java uses TeaVM's browser compiler/runtime. TeaVM compiler/runtime/classlib assets are bundled under `static/teavm/` by default, and the asset base URL can be overridden with `PUBLIC_TEAVM_BASE_URL`.
|
|
10
242
|
|
|
11
|
-
Pyodide core assets are
|
|
12
|
-
package with:
|
|
243
|
+
Pyodide's `pyodide.mjs` and core assets are served from `static/pyodide/` and loaded on demand by
|
|
244
|
+
both Python execution and Python LSP workers. Refresh them after bumping the `pyodide` package with:
|
|
13
245
|
|
|
14
246
|
```bash
|
|
15
247
|
cd wasm-idle
|
|
16
248
|
pnpm run sync:pyodide
|
|
17
249
|
```
|
|
18
250
|
|
|
19
|
-
|
|
251
|
+
WebR's browser ESM entry `webr.js` and runtime files are served from a fingerprinted directory under
|
|
252
|
+
`static/webr/`. R execution and R LSP workers share that static asset tree. Refresh it after
|
|
253
|
+
bumping `webr` with:
|
|
20
254
|
|
|
21
|
-
|
|
255
|
+
```bash
|
|
256
|
+
cd wasm-idle
|
|
257
|
+
pnpm run sync:webr
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Elixir and Erlang browser execution use an AtomVM/Popcorn AVM bundle. The Popcorn `eval-in-wasm`
|
|
261
|
+
source and vendored Popcorn Elixir build dependency now live under `runtimes/wasm-elixir/`;
|
|
262
|
+
rebuild and sync with:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
cd wasm-idle
|
|
266
|
+
pnpm --dir runtimes/wasm-elixir run bundle
|
|
267
|
+
pnpm run sync:wasm-elixir
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Erlang support uses Popcorn's upstream `eval_erlang` and `eval_erlang_module` paths. This is not a
|
|
271
|
+
handwritten wasm-idle subset, but it inherits AtomVM/Popcorn runtime limits and is not full
|
|
272
|
+
Erlang/OTP ERTS coverage. Some OTP paths that rely on missing NIFs can fail in the current bundle,
|
|
273
|
+
so the browser starter and stdin coverage use `io:get_line`/`io:format` only.
|
|
274
|
+
|
|
275
|
+
Julia browser execution uses the `@chriskoch/julia-wasm` Julia 1.0.4 asset bundle under
|
|
276
|
+
`static/wasm-julia/`. Refresh the vendored worker/runtime assets with:
|
|
22
277
|
|
|
23
278
|
```bash
|
|
24
279
|
cd wasm-idle
|
|
280
|
+
pnpm run sync:wasm-julia
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Nim browser execution uses the `benagastov/Nim-WASM-Compiler` asset pipeline under
|
|
284
|
+
`static/wasm-nim/`: Nim 2.2.4 compiled to WebAssembly emits C, then bundled clang/lld WebAssembly
|
|
285
|
+
assets link a runnable WASI module. Refresh the vendored worker/runtime assets with:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
cd wasm-idle
|
|
289
|
+
pnpm run sync:wasm-nim
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Rust browser integration
|
|
293
|
+
|
|
294
|
+
The demo app bundles the workspace `wasm-rust` browser compiler under `static/wasm-rust/` and points
|
|
295
|
+
the example `Terminal` at `/wasm-rust/index.js` by default. Refresh it with:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
pnpm --dir runtimes/wasm-rust build
|
|
25
299
|
pnpm run sync:wasm-rust
|
|
26
300
|
```
|
|
27
301
|
|
|
28
|
-
The built-in Rust route
|
|
29
|
-
target selector when Rust is active, defaults to `wasm32-wasip1`, and persists that choice
|
|
30
|
-
storage.
|
|
302
|
+
The built-in Rust route supports `wasm32-wasip1`, `wasm32-wasip2`, and `wasm32-wasip3`. The page
|
|
303
|
+
exposes a target selector when Rust is active, defaults to `wasm32-wasip1`, and persists that choice
|
|
304
|
+
in local storage. The compiler module, rustc, sysroot, and component tooling remain unloaded until
|
|
305
|
+
Rust is selected; LSP assets remain unloaded until the LSP toggle is enabled.
|
|
31
306
|
|
|
32
307
|
## TinyGo browser integration
|
|
33
308
|
|
|
34
|
-
The demo app can also vendor the
|
|
309
|
+
The demo app can also vendor the workspace `wasm-tinygo` browser build under `static/wasm-tinygo/`
|
|
35
310
|
and load its `runtime.js` entry directly inside the TinyGo playground sandbox. The example page
|
|
36
311
|
uses the bundled browser runtime by default, including on `localhost` during `vite dev` /
|
|
37
|
-
`vite preview`.
|
|
38
|
-
|
|
39
|
-
`?tinygoCompilePath=host`, if you want to use a real TinyGo compile service.
|
|
40
|
-
Refresh the
|
|
41
|
-
bundled runtime assets after rebuilding the sibling `wasm-tinygo` project with:
|
|
312
|
+
`vite preview`. Refresh the
|
|
313
|
+
bundled runtime assets after rebuilding the workspace project with:
|
|
42
314
|
|
|
43
315
|
```bash
|
|
44
|
-
|
|
45
|
-
npm run build
|
|
46
|
-
|
|
47
|
-
cd ../wasm-idle
|
|
316
|
+
pnpm --dir runtimes/wasm-tinygo build
|
|
48
317
|
pnpm run sync:wasm-tinygo
|
|
49
318
|
```
|
|
50
319
|
|
|
@@ -55,9 +324,32 @@ artifact with browser WASI so terminal stdin/EOF behavior stays consistent with
|
|
|
55
324
|
The default bundled browser path loads the vendored TinyGo runtime in `direct` mode, skips the old
|
|
56
325
|
bootstrap-only compile step, and runs runnable WASI artifacts locally. The `wasip2` and `wasip3`
|
|
57
326
|
entries use the preview target profiles shipped by the bundled `wasm-tinygo` runtime, so they may
|
|
58
|
-
produce non-runnable preview artifacts until the matching execution path is available.
|
|
59
|
-
|
|
60
|
-
|
|
327
|
+
produce non-runnable preview artifacts until the matching execution path is available.
|
|
328
|
+
|
|
329
|
+
## C# / F# / VB.NET / .NET browser integration
|
|
330
|
+
|
|
331
|
+
The demo app vendors the workspace `wasm-dotnet` browser module under `static/wasm-dotnet/` and exposes
|
|
332
|
+
C# as `CSHARP`, F# as `FSHARP`, and VB.NET as `VBNET` in the shared playground selector. Refresh the
|
|
333
|
+
browser module after rebuilding the workspace project with:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
pnpm --dir runtimes/wasm-dotnet build
|
|
337
|
+
dotnet workload install wasm-tools
|
|
338
|
+
dotnet workload install wasm-experimental
|
|
339
|
+
pnpm --dir runtimes/wasm-dotnet build:runtime
|
|
340
|
+
pnpm run sync:wasm-dotnet
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
C#, F#, and VB.NET compile in the browser through separate .NET `browser-wasm` AOT bundles at
|
|
344
|
+
`runtime/csharp/`, `runtime/fsharp/`, and `runtime/vbnet/`. `wasm-idle` loads the static
|
|
345
|
+
`wasm-dotnet` module only after a .NET language is selected; the module then loads only that
|
|
346
|
+
language's `dotnet.js` and filtered shared reference assemblies. No server-side dotnet compile route
|
|
347
|
+
is involved. For a hosted app, pass `runtimeAssets.dotnet.moduleUrl` or set
|
|
348
|
+
`PUBLIC_WASM_DOTNET_MODULE_URL`. The browser path forwards CLI args and buffered terminal stdin into
|
|
349
|
+
`Console.In`. Roslyn C#, FSharp.Compiler.Service, and Roslyn Visual Basic hot paths are selectively
|
|
350
|
+
AOT compiled in their respective bundles. Monaco diagnostics reuse the selected threaded runtime
|
|
351
|
+
through an in-process `MessageChannel` transport because the .NET pthread runtime must start on the
|
|
352
|
+
browser UI thread.
|
|
61
353
|
|
|
62
354
|
## Browser regression commands
|
|
63
355
|
|
|
@@ -97,14 +389,12 @@ Programs that intentionally read stdin until EOF can still be finished with `Ctr
|
|
|
97
389
|
The browser helper writes stdin through the page-owned `window.__wasmIdleDebug.writeTerminalInput(...)`
|
|
98
390
|
hook instead of trying to click xterm's hidden helper textarea, which proved too flaky for repeatable
|
|
99
391
|
Playwright runs.
|
|
100
|
-
The TinyGo probe follows the same pattern. The
|
|
101
|
-
`
|
|
102
|
-
default browser path should load the vendored
|
|
103
|
-
runtime in `direct` mode and avoid the old bootstrap compile command altogether.
|
|
392
|
+
The TinyGo probe follows the same pattern. The browser path should load the vendored runtime in
|
|
393
|
+
`direct` mode and avoid the old bootstrap compile command altogether.
|
|
104
394
|
The TinyGo browser commands currently default to `vite dev`.
|
|
105
395
|
If Rust ever reports `invalid metadata files for crate core` or `Unsupported archive identifier`,
|
|
106
396
|
the browser almost always fetched a stale or wrong `wasm-rust` sysroot asset. Hard refresh the page
|
|
107
|
-
and resync `static/wasm-rust/` from
|
|
397
|
+
and rebuild then resync `static/wasm-rust/` from `runtimes/wasm-rust/dist/`.
|
|
108
398
|
When browser-rustc does retry, it now emits a visible warning instead of only a debug-level
|
|
109
399
|
transition into attempt `2/5`, `3/5`, and so on.
|
|
110
400
|
When the Rust `log` option is enabled, those compile-time `wasm-rust` progress and retry lines are
|
|
@@ -119,14 +409,127 @@ session; the repo-owned regression target is the local preview path above.
|
|
|
119
409
|
|
|
120
410
|
## Runtime expectations
|
|
121
411
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
412
|
+
`@wasm-idle/terminal` is an optional browser UI package:
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
pnpm add @wasm-idle/terminal
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
The root `wasm-idle` package exports the language runtime and playground binding APIs without
|
|
419
|
+
installing Svelte or xterm. Browser applications install `@wasm-idle/terminal` separately and pass
|
|
420
|
+
it a `PlaygroundBinding`; Node hosts do not need the package.
|
|
421
|
+
|
|
422
|
+
`@wasm-idle/debug` is an optional debugger UI/controller plugin that must be installed separately:
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
pnpm add @wasm-idle/debug
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
The root `wasm-idle` package no longer exports the debug session controller, language adapters, or
|
|
429
|
+
Monaco integration. Applications that need those APIs import them from `@wasm-idle/debug`; the
|
|
430
|
+
Pages application keeps the package as a dev dependency. `svelte` is a required peer for the
|
|
431
|
+
reactive controller, while `monaco-editor` is needed only when using the editor integration.
|
|
432
|
+
|
|
433
|
+
`@wasm-idle/lsp` is an optional editor plugin that must be installed separately:
|
|
434
|
+
|
|
435
|
+
```bash
|
|
436
|
+
pnpm add @wasm-idle/lsp
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Installing the root `wasm-idle` package does not install `@wasm-idle/lsp` transitively. Consumers
|
|
440
|
+
that want browser editor LSP support must add it explicitly, along with the optional provider peers
|
|
441
|
+
they use.
|
|
442
|
+
|
|
443
|
+
The `wasm-idle`, `@wasm-idle/debug`, `@wasm-idle/terminal`, `@wasm-idle/llvm-core`, and
|
|
444
|
+
`@wasm-idle/lsp` npm packages contain host/provider JS, types, and lightweight UI/editor-service
|
|
445
|
+
code, but no compiler or language-runtime payloads. The `wasm-llvm` repository produces compiler
|
|
446
|
+
assets but is not an npm runtime dependency. Static compiler/runtime assets are deployed separately
|
|
447
|
+
and loaded through `runtimeAssets` HTTP(S) URLs. References to bundled assets below mean files
|
|
448
|
+
deployed to the page's HTTP origin, not files embedded in an npm package; library consumers must
|
|
449
|
+
provide their own externally hosted URLs.
|
|
450
|
+
|
|
451
|
+
Browser runtime payloads stored as `.wasm.gz` or `.tar.gz` use the platform
|
|
452
|
+
`DecompressionStream('gzip')` path. Zig's standard library is delivered as `std.tar.gz`, and the
|
|
453
|
+
Clang and COBOL producer archives are repackaged as `.wasm.gz`/`.tar.gz` during sync. `fflate`
|
|
454
|
+
remains for user-created workspace ZIP files and legacy external runtime URLs; it is dynamically
|
|
455
|
+
loaded for compatibility instead of participating in the default runtime path.
|
|
456
|
+
|
|
457
|
+
`@wasm-idle/lsp` keeps its host and provider JS in the package. Heavy compiler/runtime modules are
|
|
458
|
+
external static assets loaded only after LSP is enabled: Python uses `pyodide/pyodide.mjs`, R uses
|
|
459
|
+
the versioned `webr/<hash>/webr.js`, and the AssemblyScript, DuckDB/SQLite SQL, and Ruby providers
|
|
460
|
+
reuse their `static/wasm-*/runtime.mjs` trees. Other compiler-backed providers follow the same
|
|
461
|
+
external URL model through their language-server asset configuration.
|
|
462
|
+
|
|
463
|
+
Pure-JavaScript provider engines for TypeScript, GraphQL, WAT, and document languages are optional
|
|
464
|
+
peers of `@wasm-idle/lsp`, not mandatory production dependencies. The Pages application keeps
|
|
465
|
+
`@wasm-idle/lsp` as a dev dependency and dynamically imports each provider only after LSP is enabled
|
|
466
|
+
and its language is selected. Vite emits those providers into lazy worker chunks, so they are not
|
|
467
|
+
fetched before they are needed. Library consumers using one of those providers must install its
|
|
468
|
+
optional peer set, while compiler and language-runtime payloads still come only from external URLs.
|
|
469
|
+
|
|
470
|
+
Rust still supports an external browser compiler module for library consumers. Point
|
|
471
|
+
`PUBLIC_WASM_RUST_COMPILER_URL` at a built `wasm-rust` ESM entry such as
|
|
472
|
+
`.../wasm-rust/dist/index.js`, or pass `runtimeAssets.rust.compilerUrl` at runtime. Rust source
|
|
473
|
+
instrumentation is emitted as the separate `debug-instrumenter.js` static asset and is imported
|
|
474
|
+
only for debug executions. Override it with `runtimeAssets.rust.debugModuleUrl`; otherwise
|
|
475
|
+
wasm-idle resolves it beside the configured compiler module and preserves the compiler URL version
|
|
476
|
+
query.
|
|
477
|
+
TinyGo expects a browser-loadable `wasm-tinygo` runtime module. Point
|
|
127
478
|
`PUBLIC_WASM_TINYGO_MODULE_URL` at a built entry such as `.../wasm-tinygo/dist/runtime.js`, or
|
|
128
479
|
pass `runtimeAssets.tinygo.moduleUrl` at runtime. The older `PUBLIC_WASM_TINYGO_APP_URL` /
|
|
129
480
|
`runtimeAssets.tinygo.appUrl` document path is still accepted and normalized to `runtime.js`.
|
|
481
|
+
WAT uses the bundled `static/wasm-wat/` WABT browser module by default. Override it with
|
|
482
|
+
`PUBLIC_WASM_WAT_MODULE_URL`, or pass `runtimeAssets.wat.moduleUrl`.
|
|
483
|
+
WASM executes binary WebAssembly modules directly through the browser WebAssembly API. The editor
|
|
484
|
+
accepts base64, hex, or `data:application/wasm` content, and the worker connects WASI preview1
|
|
485
|
+
stdin/stdout/stderr plus the `env.readByte` import used by the WAT runner.
|
|
486
|
+
DuckDB dynamically imports `static/wasm-duckdb/runtime.mjs`, produced from
|
|
487
|
+
`@duckdb/duckdb-wasm`, and opens a fresh in-memory database per run. Override the module with
|
|
488
|
+
`PUBLIC_WASM_DUCKDB_MODULE_URL` or `runtimeAssets.duckdb.moduleUrl`. Workspace files are registered
|
|
489
|
+
before the active query; terminal input is registered as `stdin.txt` and `/dev/stdin` for queries
|
|
490
|
+
that load it as a file.
|
|
491
|
+
SQLite dynamically imports `static/wasm-sqlite/runtime.mjs`, produced from `sql.js`, and resolves
|
|
492
|
+
its default `sql-wasm.wasm` from that static tree. Override the module and optional WASM payload
|
|
493
|
+
with `runtimeAssets.sqlite.moduleUrl`/`wasmUrl` or the corresponding
|
|
494
|
+
`PUBLIC_WASM_SQLITE_MODULE_URL`/`PUBLIC_WASM_SQLITE_WASM_URL` values.
|
|
495
|
+
PHP dynamically imports the checked-in `static/wasm-php/runtime.mjs` output from the standalone
|
|
496
|
+
`producers/wasm-php` build. That producer pins `@php-wasm/web-8-4@3.1.34` and
|
|
497
|
+
`@php-wasm/universal@3.1.34`. It always creates PHP 8.4; there is no version field or
|
|
498
|
+
environment-based version selector. Override only the module location with
|
|
499
|
+
`PUBLIC_WASM_PHP_MODULE_URL` or `runtimeAssets.php.moduleUrl`. A custom host must serve the entry's
|
|
500
|
+
sibling chunks and assets with compatible CORS and cross-origin isolation headers; a cross-origin
|
|
501
|
+
host cannot use wasm-idle's same-origin gzip service worker.
|
|
502
|
+
Bash dynamically imports the Wasmer SDK from `static/wasm-bash/sdk/index.mjs`, initializes its
|
|
503
|
+
static worker, and then loads `bash.webc`. Override these three URLs with
|
|
504
|
+
`runtimeAssets.bash.moduleUrl`, `workerUrl`, and `webcUrl`, or derive all of them from `rootUrl`.
|
|
505
|
+
Lua uses the bundled `static/wasm-lua/` wasmoon browser module plus its local `glue.wasm`
|
|
506
|
+
payload by default. Override it with `PUBLIC_WASM_LUA_MODULE_URL`, or pass
|
|
507
|
+
`runtimeAssets.lua.moduleUrl`.
|
|
508
|
+
Zig uses the bundled `static/wasm-zig/zig_small.wasm` compiler and `static/wasm-zig/std.tar.gz`
|
|
509
|
+
standard library by default. Override them with `PUBLIC_WASM_ZIG_COMPILER_URL` and
|
|
510
|
+
`PUBLIC_WASM_ZIG_STDLIB_URL`, or pass `runtimeAssets.zig.compilerUrl` and
|
|
511
|
+
`runtimeAssets.zig.stdlibUrl`. The compiler runs under browser WASI, emits a `wasm64-wasi`
|
|
512
|
+
artifact with the self-hosted backend, and wasm-idle executes that artifact locally in the worker.
|
|
513
|
+
Scheme uses the bundled `static/wasm-lisp/` Puppy Scheme compiler module by default. Override it
|
|
514
|
+
with `PUBLIC_WASM_LISP_MODULE_URL`, or pass `runtimeAssets.lisp.moduleUrl`.
|
|
515
|
+
Ruby dynamically imports `static/wasm-ruby/runtime.mjs`, which exposes CRuby 3.4 and its default
|
|
516
|
+
`ruby+stdlib.wasm` URL. Override the module or WASM payload with
|
|
517
|
+
`runtimeAssets.ruby.moduleUrl`/`wasmUrl` or `PUBLIC_WASM_RUBY_MODULE_URL`/
|
|
518
|
+
`PUBLIC_WASM_RUBY_WASM_URL`.
|
|
519
|
+
AssemblyScript dynamically imports `static/wasm-assemblyscript/runtime.mjs`, produced from the
|
|
520
|
+
pinned AssemblyScript compiler and loader. Override it with
|
|
521
|
+
`PUBLIC_WASM_ASSEMBLYSCRIPT_MODULE_URL` or `runtimeAssets.assemblyscript.moduleUrl`. Compilation
|
|
522
|
+
uses `--runtime incremental --bindings raw --optimize --exportRuntime` and instantiates the emitted
|
|
523
|
+
WebAssembly locally. `_start` or `main` runs first; otherwise zero-argument numeric, boolean, and
|
|
524
|
+
string exports are printed to the terminal. AssemblyScript programs can import stdin helpers from
|
|
525
|
+
`env`: `readLine(): string | null`, `readAll(): string`, and `readByte(): i32`. `readLine` waits for
|
|
526
|
+
Enter-submitted terminal input, while `readAll` reads until Ctrl+D or the EOF button.
|
|
527
|
+
WAT modules can import `env.readByte(): i32` for byte-oriented stdin; it returns `-1` at EOF.
|
|
528
|
+
Haskell uses the bundled `static/wasm-haskell/` `ghc-in-browser` assets by default. Override them
|
|
529
|
+
with `PUBLIC_WASM_HASKELL_MODULE_URL`, `PUBLIC_WASM_HASKELL_ROOTFS_URL`, and
|
|
530
|
+
`PUBLIC_WASM_HASKELL_BSDTAR_URL`, or pass `runtimeAssets.haskell`. The worker extracts the wasm GHC
|
|
531
|
+
root filesystem, loads `dyld.mjs`, and invokes the browser GHC/GHCi entry point locally. Browser
|
|
532
|
+
stdin is wired into the dyld WASI fd0, so `getLine` reads terminal input.
|
|
130
533
|
|
|
131
534
|
The Rust browser path now executes returned artifacts through the target-appropriate runtime inside
|
|
132
535
|
the Rust worker:
|
|
@@ -144,9 +547,32 @@ import type { PlaygroundRuntimeAssets } from 'wasm-idle';
|
|
|
144
547
|
|
|
145
548
|
const runtimeAssets: PlaygroundRuntimeAssets = {
|
|
146
549
|
rootUrl: 'https://cdn.example.com/repl',
|
|
550
|
+
assemblyscript: {
|
|
551
|
+
moduleUrl: 'https://cdn.example.com/repl/wasm-assemblyscript/runtime.mjs'
|
|
552
|
+
},
|
|
553
|
+
duckdb: {
|
|
554
|
+
moduleUrl: 'https://cdn.example.com/repl/wasm-duckdb/runtime.mjs'
|
|
555
|
+
},
|
|
556
|
+
php: {
|
|
557
|
+
moduleUrl: 'https://cdn.example.com/repl/wasm-php/runtime.mjs'
|
|
558
|
+
},
|
|
559
|
+
ruby: {
|
|
560
|
+
moduleUrl: 'https://cdn.example.com/repl/wasm-ruby/runtime.mjs'
|
|
561
|
+
},
|
|
562
|
+
sqlite: {
|
|
563
|
+
moduleUrl: 'https://cdn.example.com/repl/wasm-sqlite/runtime.mjs'
|
|
564
|
+
},
|
|
565
|
+
bash: {
|
|
566
|
+
moduleUrl: 'https://cdn.example.com/repl/wasm-bash/sdk/index.mjs',
|
|
567
|
+
workerUrl: 'https://cdn.example.com/repl/wasm-bash/sdk/worker.mjs',
|
|
568
|
+
webcUrl: 'https://cdn.example.com/repl/wasm-bash/bash.webc'
|
|
569
|
+
},
|
|
147
570
|
python: {
|
|
148
571
|
loader: async ({ asset }) => ({ url: `https://cdn.example.com/repl/pyodide/${asset}` })
|
|
149
572
|
},
|
|
573
|
+
r: {
|
|
574
|
+
baseUrl: 'https://cdn.example.com/repl/webr/<asset-version>/'
|
|
575
|
+
},
|
|
150
576
|
java: {
|
|
151
577
|
baseUrl: 'https://cdn.example.com/repl/teavm/'
|
|
152
578
|
},
|
|
@@ -159,27 +585,68 @@ const runtimeAssets: PlaygroundRuntimeAssets = {
|
|
|
159
585
|
rust: {
|
|
160
586
|
compilerUrl: 'https://cdn.example.com/wasm-rust/index.js'
|
|
161
587
|
},
|
|
588
|
+
dotnet: {
|
|
589
|
+
moduleUrl: 'https://cdn.example.com/wasm-dotnet/index.js'
|
|
590
|
+
},
|
|
162
591
|
tinygo: {
|
|
163
|
-
hostCompileUrl: 'https://tinygo.example.com/api/compile',
|
|
164
592
|
moduleUrl: 'https://cdn.example.com/wasm-tinygo/runtime.js'
|
|
593
|
+
},
|
|
594
|
+
wat: {
|
|
595
|
+
moduleUrl: 'https://cdn.example.com/wasm-wat/index.js'
|
|
596
|
+
},
|
|
597
|
+
lua: {
|
|
598
|
+
moduleUrl: 'https://cdn.example.com/wasm-lua/index.js'
|
|
599
|
+
},
|
|
600
|
+
zig: {
|
|
601
|
+
compilerUrl: 'https://cdn.example.com/wasm-zig/zig_small.wasm',
|
|
602
|
+
stdlibUrl: 'https://cdn.example.com/wasm-zig/std.tar.gz'
|
|
603
|
+
},
|
|
604
|
+
lisp: {
|
|
605
|
+
moduleUrl: 'https://cdn.example.com/wasm-lisp/index.js'
|
|
606
|
+
},
|
|
607
|
+
haskell: {
|
|
608
|
+
moduleUrl: 'https://cdn.example.com/wasm-haskell/dyld.mjs',
|
|
609
|
+
rootfsUrl: 'https://cdn.example.com/wasm-haskell/rootfs.tar.zst',
|
|
610
|
+
bsdtarUrl: 'https://cdn.example.com/wasm-haskell/bsdtar.wasm'
|
|
611
|
+
},
|
|
612
|
+
janet: {
|
|
613
|
+
baseUrl: 'https://cdn.example.com/wasm-janet/',
|
|
614
|
+
workerUrl: 'https://cdn.example.com/wasm-janet/runner-worker.js'
|
|
615
|
+
},
|
|
616
|
+
julia: {
|
|
617
|
+
baseUrl: 'https://cdn.example.com/wasm-julia/',
|
|
618
|
+
workerUrl: 'https://cdn.example.com/wasm-julia/runner-worker.js'
|
|
619
|
+
},
|
|
620
|
+
nim: {
|
|
621
|
+
baseUrl: 'https://cdn.example.com/wasm-nim/',
|
|
622
|
+
workerUrl: 'https://cdn.example.com/wasm-nim/runner-worker.js'
|
|
165
623
|
}
|
|
166
624
|
};
|
|
167
625
|
```
|
|
168
626
|
|
|
169
|
-
|
|
627
|
+
Static module overrides such as PHP's `moduleUrl` identify an entry module, not a self-contained
|
|
628
|
+
file. Mirror its complete sibling asset tree at the same relative paths. Cross-origin asset hosts
|
|
629
|
+
must provide compatible CORS and COEP/CORP headers and cannot rely on wasm-idle's same-origin gzip
|
|
630
|
+
service worker.
|
|
170
631
|
|
|
171
|
-
|
|
632
|
+
Python custom loaders receive file names under the Pyodide asset root and can serve both core assets and package files. TeaVM custom loaders receive file names under the TeaVM asset root. Clang custom loaders receive `bin/memfs.wasm.gz`, `bin/clang.wasm.gz`, `bin/lld.wasm.gz`, and `bin/sysroot.tar.gz`; COBOL loaders receive `cobc.wasm.gz`, `rootfs.tar.gz`, and `c-sysroot.tar.gz`. The shared loader pipes these gzip response bodies through native `DecompressionStream`. Legacy external manifests that still reference ZIP assets remain supported through the dynamically loaded `fflate` compatibility path. Zig custom loaders receive `zig_small.wasm` and `std.tar.gz`; an explicitly configured legacy `std.zip` URL remains compatible. Clangd custom loaders receive `clangd.js` and `clangd.wasm.gz`, with the worker decompressing the gzip payload before instantiation. Rust expects a browser-loadable compiler module URL; that module is responsible for serving its own nested runtime assets. C#, F#, and VB.NET expect a browser-loadable `wasm-dotnet` module with its language-specific static .NET `browser-wasm` runtime assets. TinyGo expects a browser-loadable runtime module. The browser runtime now ships a direct-mode execution path that can produce and run the bundled TinyGo WASI artifact locally, alongside `tools/go-probe.wasm` and vendored emception assets. TinyGo also accepts a runtime asset loader + pack bundle in `runtimeAssets.tinygo` when you need to serve runtime assets out of a single compressed archive. Compressed TeaVM runtime assets are no longer unpacked inside the library; provide the final file URL or handle decompression in your own loader.
|
|
633
|
+
|
|
634
|
+
To reuse the same runtime asset configuration for both `<Terminal>` and direct `playground(...)`
|
|
635
|
+
access, bind it once:
|
|
172
636
|
|
|
173
637
|
```ts
|
|
174
|
-
import Terminal
|
|
638
|
+
import Terminal from '@wasm-idle/terminal';
|
|
639
|
+
import { createPlaygroundBinding } from 'wasm-idle';
|
|
175
640
|
|
|
176
641
|
const wasmIdle = createPlaygroundBinding({
|
|
177
642
|
rootUrl: 'https://cdn.example.com/repl',
|
|
178
643
|
rust: {
|
|
179
644
|
compilerUrl: 'https://cdn.example.com/wasm-rust/index.js'
|
|
180
645
|
},
|
|
646
|
+
dotnet: {
|
|
647
|
+
moduleUrl: 'https://cdn.example.com/wasm-dotnet/index.js'
|
|
648
|
+
},
|
|
181
649
|
tinygo: {
|
|
182
|
-
hostCompileUrl: 'https://tinygo.example.com/api/compile',
|
|
183
650
|
moduleUrl: 'https://cdn.example.com/wasm-tinygo/runtime.js',
|
|
184
651
|
assetPacks: [
|
|
185
652
|
{
|
|
@@ -200,5 +667,7 @@ await sandbox.load('print("hi")', false);
|
|
|
200
667
|
<Terminal {...wasmIdle.terminalProps} bind:terminal />
|
|
201
668
|
```
|
|
202
669
|
|
|
203
|
-
|
|
204
|
-
`wasm-
|
|
670
|
+
Compiler assets produced by [`wasm-llvm`](https://github.com/seo-rii/wasm-llvm) are deployed to
|
|
671
|
+
external static hosting and loaded by `@wasm-idle/llvm-core`. Also powered by Pyodide, TeaVM, `wasm-rust`,
|
|
672
|
+
`wasm-tinygo`, `wasm-dotnet`, `wasm-of-js-of-ocaml`, `wasm-typescript`, `wasm-lisp`,
|
|
673
|
+
`wasm-wat`, `wasm-lua`, `wasm-zig`, CBQN, Janet, AtomVM/Popcorn, and `ghc-in-browser`.
|