wasm-idle 0.7.2 → 1.0.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 +760 -81
- package/dist/index.d.ts +4 -9
- package/dist/index.js +2 -4
- package/dist/playground/applicationAssets.d.ts +4 -0
- package/dist/playground/applicationAssets.js +277 -0
- package/dist/playground/assemblyscript.d.ts +41 -0
- package/dist/playground/assemblyscript.js +630 -0
- package/dist/playground/assetBridge.d.ts +18 -7
- package/dist/playground/assetBridge.js +824 -100
- package/dist/playground/assets.d.ts +813 -19
- package/dist/playground/assets.js +2096 -156
- package/dist/playground/awk.d.ts +5 -0
- package/dist/playground/awk.js +60 -0
- package/dist/playground/bash.d.ts +53 -0
- package/dist/playground/bash.js +1096 -0
- package/dist/playground/bashWorkerProtocol.d.ts +88 -0
- package/dist/playground/bashWorkerProtocol.js +135 -0
- package/dist/playground/bqn.d.ts +5 -0
- package/dist/playground/bqn.js +57 -0
- package/dist/playground/bqnPreflight.d.ts +26 -0
- package/dist/playground/bqnPreflight.js +399 -0
- package/dist/playground/c3.d.ts +15 -0
- package/dist/playground/c3.js +154 -0
- package/dist/playground/clang.d.ts +35 -19
- package/dist/playground/clang.js +241 -52
- package/dist/playground/clangAssetIntegrity.d.ts +32 -0
- package/dist/playground/clangAssetIntegrity.js +8 -0
- package/dist/playground/clojurescript.d.ts +5 -0
- package/dist/playground/clojurescript.js +59 -0
- package/dist/playground/clojurescriptPreflight.d.ts +26 -0
- package/dist/playground/clojurescriptPreflight.js +383 -0
- package/dist/playground/cobol.d.ts +46 -0
- package/dist/playground/cobol.js +703 -0
- package/dist/playground/d.d.ts +47 -0
- package/dist/playground/d.js +644 -0
- package/dist/playground/dOuterAssets.d.ts +16 -0
- package/dist/playground/dOuterAssets.js +163 -0
- package/dist/playground/dotnet.d.ts +99 -0
- package/dist/playground/dotnet.js +1131 -0
- package/dist/playground/duckdb.d.ts +36 -0
- package/dist/playground/duckdb.js +542 -0
- package/dist/playground/elixir.d.ts +18 -10
- package/dist/playground/elixir.js +630 -96
- package/dist/playground/elixirAssets.d.ts +6 -0
- package/dist/playground/elixirAssets.js +33 -0
- package/dist/playground/executionObservation.d.ts +22 -0
- package/dist/playground/executionObservation.js +65 -0
- package/dist/playground/forth.d.ts +5 -0
- package/dist/playground/forth.js +53 -0
- package/dist/playground/forthPreflight.d.ts +24 -0
- package/dist/playground/forthPreflight.js +198 -0
- package/dist/playground/fortran.d.ts +47 -0
- package/dist/playground/fortran.js +651 -0
- package/dist/playground/fortranAssets.d.ts +6 -0
- package/dist/playground/fortranAssets.js +27 -0
- package/dist/playground/gleam.d.ts +6 -0
- package/dist/playground/gleam.js +33 -0
- package/dist/playground/go.d.ts +17 -11
- package/dist/playground/go.js +376 -72
- package/dist/playground/goDebugInstrumentation.d.ts +1 -0
- package/dist/playground/goDebugInstrumentation.js +229 -0
- package/dist/playground/haskell.d.ts +44 -0
- package/dist/playground/haskell.js +678 -0
- package/dist/playground/haskellAssets.d.ts +24 -0
- package/dist/playground/haskellAssets.js +93 -0
- package/dist/playground/index.d.ts +1 -1
- package/dist/playground/index.js +360 -111
- package/dist/playground/j.d.ts +5 -0
- package/dist/playground/j.js +60 -0
- package/dist/playground/jPreflight.d.ts +26 -0
- package/dist/playground/jPreflight.js +372 -0
- package/dist/playground/janet.d.ts +5 -0
- package/dist/playground/janet.js +64 -0
- package/dist/playground/java.d.ts +24 -10
- package/dist/playground/java.js +706 -84
- package/dist/playground/javaSource.d.ts +5 -0
- package/dist/playground/javaSource.js +16 -0
- package/dist/playground/javaStdin.d.ts +1 -1
- package/dist/playground/javaStdin.js +13 -4
- package/dist/playground/julia.d.ts +5 -0
- package/dist/playground/julia.js +64 -0
- package/dist/playground/lfortran.d.ts +8 -0
- package/dist/playground/lfortran.js +30 -0
- package/dist/playground/lfortranAssets.d.ts +21 -0
- package/dist/playground/lfortranAssets.js +118 -0
- package/dist/playground/lisp.d.ts +45 -0
- package/dist/playground/lisp.js +640 -0
- package/dist/playground/lispAssets.d.ts +9 -0
- package/dist/playground/lispAssets.js +74 -0
- package/dist/playground/lldbManifest.d.ts +3 -0
- package/dist/playground/lldbManifest.js +155 -0
- package/dist/playground/lldbSession.d.ts +115 -0
- package/dist/playground/lldbSession.js +1347 -0
- package/dist/playground/loadingProgress.d.ts +16 -0
- package/dist/playground/loadingProgress.js +166 -0
- package/dist/playground/lua.d.ts +44 -0
- package/dist/playground/lua.js +630 -0
- package/dist/playground/nim.d.ts +5 -0
- package/dist/playground/nim.js +76 -0
- package/dist/playground/objectivec.d.ts +39 -0
- package/dist/playground/objectivec.js +288 -0
- package/dist/playground/ocaml.d.ts +28 -10
- package/dist/playground/ocaml.js +815 -253
- package/dist/playground/octave.d.ts +43 -0
- package/dist/playground/octave.js +783 -0
- package/dist/playground/options.d.ts +19 -40
- package/dist/playground/options.js +2 -1
- package/dist/playground/pascal.d.ts +5 -0
- package/dist/playground/pascal.js +60 -0
- package/dist/playground/perl.d.ts +5 -0
- package/dist/playground/perl.js +61 -0
- package/dist/playground/php.d.ts +44 -0
- package/dist/playground/php.js +665 -0
- package/dist/playground/prolog.d.ts +6 -0
- package/dist/playground/prolog.js +75 -0
- package/dist/playground/python.d.ts +20 -14
- package/dist/playground/python.js +445 -101
- package/dist/playground/pythonPackageLock.d.ts +6 -0
- package/dist/playground/pythonPackageLock.js +56 -0
- package/dist/playground/r.d.ts +44 -0
- package/dist/playground/r.js +637 -0
- package/dist/playground/ruby.d.ts +46 -0
- package/dist/playground/ruby.js +732 -0
- package/dist/playground/rubyAssets.d.ts +23 -0
- package/dist/playground/rubyAssets.js +68 -0
- package/dist/playground/rubyTestPreflight.d.ts +2 -0
- package/dist/playground/rubyTestPreflight.js +18 -0
- package/dist/playground/runtimeModule.d.ts +1 -0
- package/dist/playground/runtimeModule.js +5 -0
- package/dist/playground/rust.d.ts +44 -13
- package/dist/playground/rust.js +714 -76
- package/dist/playground/rustExecutableGraph.d.ts +85 -0
- package/dist/playground/rustExecutableGraph.js +946 -0
- package/dist/playground/rustWorkerLimits.d.ts +17 -0
- package/dist/playground/rustWorkerLimits.js +34 -0
- package/dist/playground/sandbox.d.ts +16 -10
- package/dist/playground/sharedBuffer.d.ts +6 -0
- package/dist/playground/sharedBuffer.js +12 -0
- package/dist/playground/sqlite.d.ts +38 -0
- package/dist/playground/sqlite.js +550 -0
- package/dist/playground/staticRuntimeModuleVersion.d.ts +1 -0
- package/dist/playground/staticRuntimeModuleVersion.js +2 -0
- package/dist/playground/staticRuntimePreflight.d.ts +13 -0
- package/dist/playground/staticRuntimePreflight.js +231 -0
- package/dist/playground/staticRuntimePreflightExecute.d.ts +8 -0
- package/dist/playground/staticRuntimePreflightExecute.js +66 -0
- package/dist/playground/staticRuntimePreflightProtocol.d.ts +68 -0
- package/dist/playground/staticRuntimePreflightProtocol.js +339 -0
- package/dist/playground/staticStdinRing.d.ts +45 -0
- package/dist/playground/staticStdinRing.js +158 -0
- package/dist/playground/staticWorkerRuntime.d.ts +154 -0
- package/dist/playground/staticWorkerRuntime.js +1917 -0
- package/dist/playground/stdinBuffer.d.ts +9 -7
- package/dist/playground/stdinBuffer.js +9 -18
- package/dist/playground/swift.d.ts +5 -0
- package/dist/playground/swift.js +17 -0
- package/dist/playground/tcl.d.ts +5 -0
- package/dist/playground/tcl.js +62 -0
- package/dist/playground/teavmConfig.d.ts +1 -1
- package/dist/playground/teavmConfig.js +2 -2
- package/dist/playground/tinygo.d.ts +48 -18
- package/dist/playground/tinygo.js +1202 -329
- package/dist/playground/tinygoExecutableGraph.d.ts +44 -0
- package/dist/playground/tinygoExecutableGraph.js +449 -0
- package/dist/playground/typescript.d.ts +55 -0
- package/dist/playground/typescript.js +924 -0
- package/dist/playground/wasm.d.ts +43 -0
- package/dist/playground/wasm.js +608 -0
- package/dist/playground/wasmAwkVersion.d.ts +59 -0
- package/dist/playground/wasmAwkVersion.js +31 -0
- package/dist/playground/wasmBashVersion.d.ts +63 -0
- package/dist/playground/wasmBashVersion.js +36 -0
- package/dist/playground/wasmBqnVersion.d.ts +24 -0
- package/dist/playground/wasmBqnVersion.js +24 -0
- package/dist/playground/wasmC3Version.d.ts +20 -0
- package/dist/playground/wasmC3Version.js +21 -0
- package/dist/playground/wasmClojureScriptVersion.d.ts +21 -0
- package/dist/playground/wasmClojureScriptVersion.js +21 -0
- package/dist/playground/wasmDIntegrity.d.ts +15 -0
- package/dist/playground/wasmDIntegrity.js +15 -0
- package/dist/playground/wasmDVersion.d.ts +1 -0
- package/dist/playground/wasmDVersion.js +1 -0
- package/dist/playground/wasmDebugVersion.d.ts +6 -0
- package/dist/playground/wasmDebugVersion.js +6 -0
- package/dist/playground/wasmDotnetVersion.d.ts +1 -0
- package/dist/playground/wasmDotnetVersion.js +1 -0
- package/dist/playground/wasmElixirVersion.d.ts +21 -1
- package/dist/playground/wasmElixirVersion.js +21 -1
- package/dist/playground/wasmForthVersion.d.ts +18 -0
- package/dist/playground/wasmForthVersion.js +18 -0
- package/dist/playground/wasmFortranExecutionAssets.d.ts +15 -0
- package/dist/playground/wasmFortranExecutionAssets.js +15 -0
- package/dist/playground/wasmFortranVersion.d.ts +1 -0
- package/dist/playground/wasmFortranVersion.js +1 -0
- package/dist/playground/wasmGleamVersion.d.ts +5 -0
- package/dist/playground/wasmGleamVersion.js +5 -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 +24 -0
- package/dist/playground/wasmJVersion.js +24 -0
- package/dist/playground/wasmJanetVersion.d.ts +53 -0
- package/dist/playground/wasmJanetVersion.js +30 -0
- package/dist/playground/wasmJuliaVersion.d.ts +71 -0
- package/dist/playground/wasmJuliaVersion.js +39 -0
- package/dist/playground/wasmLfortranVersion.d.ts +28 -0
- package/dist/playground/wasmLfortranVersion.js +29 -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 +125 -0
- package/dist/playground/wasmNimVersion.js +66 -0
- package/dist/playground/wasmObjectiveCVersion.d.ts +27 -0
- package/dist/playground/wasmObjectiveCVersion.js +27 -0
- package/dist/playground/wasmOcamlVersion.d.ts +12 -1
- package/dist/playground/wasmOcamlVersion.js +12 -1
- package/dist/playground/wasmOctaveVersion.d.ts +1 -0
- package/dist/playground/wasmOctaveVersion.js +1 -0
- package/dist/playground/wasmPascalVersion.d.ts +61 -0
- package/dist/playground/wasmPascalVersion.js +34 -0
- package/dist/playground/wasmPerlVersion.d.ts +71 -0
- package/dist/playground/wasmPerlVersion.js +39 -0
- package/dist/playground/wasmPrologVersion.d.ts +31 -0
- package/dist/playground/wasmPrologVersion.js +31 -0
- package/dist/playground/wasmRVersion.d.ts +1 -0
- package/dist/playground/wasmRVersion.js +1 -0
- package/dist/playground/wasmRustVersion.d.ts +1306 -1
- package/dist/playground/wasmRustVersion.js +1458 -1
- package/dist/playground/wasmSwiftVersion.d.ts +1 -0
- package/dist/playground/wasmSwiftVersion.js +1 -0
- package/dist/playground/wasmTclVersion.d.ts +85 -0
- package/dist/playground/wasmTclVersion.js +46 -0
- package/dist/playground/wasmTinyGoVersion.d.ts +98 -1
- package/dist/playground/wasmTinyGoVersion.js +107 -1
- package/dist/playground/wasmTypeScriptVersion.d.ts +5 -0
- package/dist/playground/wasmTypeScriptVersion.js +5 -0
- package/dist/playground/wasmWatVersion.d.ts +1 -0
- package/dist/playground/wasmWatVersion.js +1 -0
- package/dist/playground/wasmZigVersion.d.ts +13 -0
- package/dist/playground/wasmZigVersion.js +13 -0
- package/dist/playground/wat.d.ts +44 -0
- package/dist/playground/wat.js +622 -0
- package/dist/playground/worker/assemblyscript.js +339 -0
- package/dist/playground/worker/assets.d.ts +7 -0
- package/dist/playground/worker/assets.js +288 -39
- package/dist/playground/worker/bash.js +338 -0
- package/dist/playground/worker/bashNestedBootstrap.d.ts +6 -0
- package/dist/playground/worker/bashNestedBootstrap.js +59 -0
- package/dist/playground/worker/bashRuntime.d.ts +89 -0
- package/dist/playground/worker/bashRuntime.js +982 -0
- package/dist/playground/worker/clang.js +92 -13
- package/dist/playground/worker/cobol.js +107 -0
- package/dist/playground/worker/d.js +199 -0
- package/dist/playground/worker/dotnet.js +141 -0
- package/dist/playground/worker/duckdb.d.ts +1 -0
- package/dist/playground/worker/duckdb.js +136 -0
- package/dist/playground/worker/elixir.js +307 -41
- package/dist/playground/worker/fortran.d.ts +1 -0
- package/dist/playground/worker/fortran.js +295 -0
- package/dist/playground/worker/go.js +246 -40
- package/dist/playground/worker/haskell.d.ts +7 -0
- package/dist/playground/worker/haskell.js +465 -0
- package/dist/playground/worker/java.js +59 -20
- package/dist/playground/worker/lisp.d.ts +1 -0
- package/dist/playground/worker/lisp.js +195 -0
- package/dist/playground/worker/lua.d.ts +1 -0
- package/dist/playground/worker/lua.js +163 -0
- package/dist/playground/worker/objectivec.d.ts +1 -0
- package/dist/playground/worker/objectivec.js +10 -0
- package/dist/playground/worker/ocaml.js +206 -58
- package/dist/playground/worker/php.d.ts +1 -0
- package/dist/playground/worker/php.js +261 -0
- package/dist/playground/worker/python.js +201 -44
- package/dist/playground/worker/r.d.ts +1 -0
- package/dist/playground/worker/r.js +192 -0
- package/dist/playground/worker/ruby.d.ts +1 -0
- package/dist/playground/worker/ruby.js +248 -0
- package/dist/playground/worker/runtimeAssetFetch.d.ts +15 -0
- package/dist/playground/worker/runtimeAssetFetch.js +375 -0
- package/dist/playground/worker/rust.js +546 -20
- package/dist/playground/worker/sqlite.d.ts +1 -0
- package/dist/playground/worker/sqlite.js +112 -0
- package/dist/playground/worker/staticRuntimePreflight.d.ts +1 -0
- package/dist/playground/worker/staticRuntimePreflight.js +56 -0
- package/dist/playground/worker/tinygo.js +34 -9
- package/dist/playground/worker/typescript.d.ts +1 -0
- package/dist/playground/worker/typescript.js +251 -0
- package/dist/playground/worker/wasm.d.ts +1 -0
- package/dist/playground/worker/wasm.js +273 -0
- package/dist/playground/worker/wat.d.ts +1 -0
- package/dist/playground/worker/wat.js +188 -0
- package/dist/playground/worker/zig.d.ts +8 -0
- package/dist/playground/worker/zig.js +578 -0
- package/dist/playground/workerProgress.d.ts +15 -0
- package/dist/playground/workerProgress.js +72 -0
- package/dist/playground/workerSession.d.ts +28 -0
- package/dist/playground/workerSession.js +164 -0
- package/dist/playground/zig.d.ts +46 -0
- package/dist/playground/zig.js +690 -0
- package/dist/playground/zigAssets.d.ts +6 -0
- package/dist/playground/zigAssets.js +49 -0
- package/package.json +234 -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/bash.d.ts} +0 -0
- /package/dist/{lsp/python/main.worker.d.ts → playground/worker/cobol.d.ts} +0 -0
- /package/dist/{lsp/types.js → playground/worker/d.d.ts} +0 -0
- /package/dist/{terminal/types.js → playground/worker/dotnet.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -2,94 +2,592 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
Executes C++, Python, Java, Rust,
|
|
5
|
+
Executes C, C++, Objective-C, Fortran, COBOL, 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, OCaml, JavaScript, TypeScript,
|
|
7
|
+
AssemblyScript, WAT, WASM, Lua, Zig, Scheme, Ruby, Haskell, R, Octave, SQLite, DuckDB,
|
|
8
|
+
and PHP code.
|
|
9
|
+
|
|
10
|
+
Experimental LFortran execution is available separately from f2c Fortran; see
|
|
11
|
+
[the LFortran consumer contract and local setup](docs/lfortran.md).
|
|
12
|
+
|
|
13
|
+
The browser-side C-family host is provided by [`@wasm-idle/llvm-core`](packages/llvm-core).
|
|
14
|
+
Compiler source pins, patches, and reproducible asset builds live in
|
|
15
|
+
[`seo-rii/wasm-llvm`](https://github.com/seo-rii/wasm-llvm); wasm-idle loads the generated
|
|
16
|
+
artifacts from external URLs instead of embedding them in npm packages.
|
|
17
|
+
|
|
18
|
+
## Language support policy
|
|
19
|
+
|
|
20
|
+
wasm-idle language support must run user code through the real language implementation in the
|
|
21
|
+
browser, normally via a WebAssembly compiler, interpreter, or runtime. Do not add handwritten
|
|
22
|
+
parsers, translators, emulators, or "subset" executors as language support. A language should be
|
|
23
|
+
listed only after normal user code runs on that actual runtime and stdin/stdout behavior, or a
|
|
24
|
+
documented stdin limitation, is covered by tests.
|
|
25
|
+
|
|
26
|
+
## Support matrix
|
|
27
|
+
|
|
28
|
+
All execution entries run in the browser through real runtime, compiler, or interpreter
|
|
29
|
+
implementations. `Editor support` lists browser LSP/compiler diagnostics when wired; `syntax`
|
|
30
|
+
means Monaco syntax highlighting only. C, C++, and `wasm32-wasip1` Rust use the browser LLDB/WAMR
|
|
31
|
+
debug runtime; the remaining debug-enabled languages retain wasm-idle's trace controls.
|
|
32
|
+
|
|
33
|
+
| Language | Browser runtime/compiler | Stdin | Editor support | Debug |
|
|
34
|
+
| -------------- | --------------------------------------- | ----- | -------------------- | ----- |
|
|
35
|
+
| C3 | C3 0.8.3 + LLVM/lld WASM (byte ABI) | Yes | compiler diagnostics | - |
|
|
36
|
+
| C | @wasm-idle/llvm-core / Clang WASI | Yes | clangd | LLDB |
|
|
37
|
+
| C++ | @wasm-idle/llvm-core / Clang WASI | Yes | clangd | LLDB |
|
|
38
|
+
| Objective-C | GNUstep libobjc2 + @wasm-idle/llvm-core | Yes | clangd | Trace |
|
|
39
|
+
| Python | Pyodide | Yes | Python LSP | Trace |
|
|
40
|
+
| Java | TeaVM | Yes | syntax | - |
|
|
41
|
+
| Rust | wasm-rust / browser rustc | Yes | rustc diagnostics | LLDB |
|
|
42
|
+
| Go | wasm-go / browser Go compiler | Yes | compiler diagnostics | Trace |
|
|
43
|
+
| D | wasm-d | Yes | syntax | - |
|
|
44
|
+
| C# | wasm-dotnet | Yes | compiler diagnostics | - |
|
|
45
|
+
| F# | wasm-dotnet | Yes | compiler diagnostics | - |
|
|
46
|
+
| VB.NET | wasm-dotnet | Yes | compiler diagnostics | - |
|
|
47
|
+
| Elixir | AtomVM / Popcorn | Yes | syntax | - |
|
|
48
|
+
| Erlang | AtomVM / Popcorn | Yes | syntax | - |
|
|
49
|
+
| Prolog | SWI-Prolog WASM worker | Yes | syntax | - |
|
|
50
|
+
| Gleam | Gleam precompiled browser runtime | Yes | compiler diagnostics | - |
|
|
51
|
+
| Perl | Perl WASM worker | Yes | syntax | - |
|
|
52
|
+
| Tcl | Wacl Tcl WASM worker | Yes | syntax | - |
|
|
53
|
+
| AWK | GoAWK WASM worker | Yes | syntax | - |
|
|
54
|
+
| Pascal | pas2js worker | Yes | syntax | - |
|
|
55
|
+
| Forth | WAForth WASM worker | Yes | syntax | - |
|
|
56
|
+
| J | J playground WASM worker | Yes | syntax | - |
|
|
57
|
+
| BQN | CBQN WASM worker | Yes | syntax | - |
|
|
58
|
+
| Janet | Janet VM WASM worker | Yes | syntax | - |
|
|
59
|
+
| Julia | Julia 1.3.0-DEV.560 legacy WASM worker | Yes | syntax | - |
|
|
60
|
+
| Nim | Nim 2.2.4 WASM + clang/lld WASM | Yes | syntax | - |
|
|
61
|
+
| Bash | GNU Bash WASIX / Wasmer SDK | Yes | syntax | - |
|
|
62
|
+
| ClojureScript | cljs.js self-hosted compiler | Yes | syntax | - |
|
|
63
|
+
| TinyGo | wasm-tinygo | Yes | syntax | - |
|
|
64
|
+
| OCaml | wasm-of-js-of-ocaml / js_of_ocaml | Yes | syntax | - |
|
|
65
|
+
| JavaScript | wasm-typescript / TypeScript service | Yes | TypeScript LSP | - |
|
|
66
|
+
| TypeScript | wasm-typescript / TypeScript service | Yes | TypeScript LSP | - |
|
|
67
|
+
| AssemblyScript | AssemblyScript compiler | Yes | AssemblyScript LSP | - |
|
|
68
|
+
| WAT | WABT | Yes | WAT LSP | - |
|
|
69
|
+
| WASM | Browser WebAssembly + WASI shim | Yes | syntax | - |
|
|
70
|
+
| Lua | Wasmoon | Yes | syntax | - |
|
|
71
|
+
| Zig | zig_small.wasm | Yes | syntax | - |
|
|
72
|
+
| Scheme | Puppy Scheme / wasm-lisp | Yes | syntax | - |
|
|
73
|
+
| Ruby | CRuby WASI | Yes | syntax | - |
|
|
74
|
+
| Haskell | ghc-in-browser | Yes | syntax | - |
|
|
75
|
+
| LFortran | LFortran LLVM evaluator (experimental) | Yes | compiler diagnostics | - |
|
|
76
|
+
| Fortran | f2c + @wasm-idle/llvm-core | Yes | Fortran LSP | - |
|
|
77
|
+
| COBOL | GnuCOBOL 3.2 + @wasm-idle/llvm-core | Yes | syntax | - |
|
|
78
|
+
| R | WebR | Yes | syntax | - |
|
|
79
|
+
| Octave | wasm-octave | Yes | syntax | - |
|
|
80
|
+
| DuckDB | DuckDB-Wasm | Files | DuckDB LSP | - |
|
|
81
|
+
| SQLite | sql.js | n/a | syntax | - |
|
|
82
|
+
| PHP | PHP 8.4 / php-wasm | Yes | syntax | - |
|
|
83
|
+
|
|
84
|
+
## Browser LLDB debug runtime
|
|
85
|
+
|
|
86
|
+
Normal execution still compiles and instantiates the user module with the browser WebAssembly
|
|
87
|
+
engine and the existing WASI host. C, C++, and `wasm32-wasip1` Rust debug sessions use a separate,
|
|
88
|
+
lazy-loaded path:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
Monaco / debug UI
|
|
92
|
+
↕ DAP over a SharedArrayBuffer byte stream
|
|
93
|
+
LLDB worker (ProcessWasm + DWARF)
|
|
94
|
+
↕ GDB RSP over a separate SharedArrayBuffer byte stream
|
|
95
|
+
WAMR target worker (classic interpreter + source-debug stub)
|
|
96
|
+
↕
|
|
97
|
+
program.wasm + embedded DWARF + WASI
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The compiler writes stable `/workspace/...` paths and embedded DWARF at `-O0`. The target is loaded
|
|
101
|
+
before LLDB attaches; breakpoints and `configurationDone` are completed before WAMR starts the
|
|
102
|
+
guest. Program output, input, lifecycle control, DAP, and RSP use separate logical streams.
|
|
103
|
+
Breakpoints are retained per source path, so switching between C/C++ workspace files does not leak
|
|
104
|
+
line numbers into another file and changes made while compilation is in flight are applied when the
|
|
105
|
+
debug target connects.
|
|
106
|
+
`@wasm-idle/debug` remains a code-only UI/adapter package, while
|
|
107
|
+
`@wasm-idle/llvm-core/debug` owns the browser session and `wasm-llvm` owns the pinned LLDB/WAMR
|
|
108
|
+
producers and binary manifests.
|
|
109
|
+
|
|
110
|
+
Debugging requires `SharedArrayBuffer` and a cross-origin-isolated deployment. Because verified
|
|
111
|
+
runtime bytes are executed through Blob-backed ES modules and nested pthread Workers, the deployed
|
|
112
|
+
Content Security Policy's `script-src`, `worker-src`, and `connect-src` must permit `blob:`. The
|
|
113
|
+
LLDB and WAMR assets are not downloaded until a supported debug session starts. The bundled raw manifest is
|
|
114
|
+
checked against its release receipt before parsing, and custom runtime locations must provide an
|
|
115
|
+
explicit expected manifest SHA-256. The six executable assets are then streamed, bounded, and
|
|
116
|
+
hash-verified exactly once before their owned bytes are transferred to the Workers. Workers do not
|
|
117
|
+
re-fetch executable runtime URLs. Clean Pages builds fetch the exact pinned producer revision and
|
|
118
|
+
manifest receipt through the shared release profile before the application build. The deployment
|
|
119
|
+
refuses publication when any logical LLDB/WAMR asset is missing or mismatched after re-verifying
|
|
120
|
+
raw or compressed logical bytes. If transactional publication cannot safely restore or identify an
|
|
121
|
+
owned generation, its `.wasm-debug.next-*` and `.wasm-debug.previous-*` recovery artifacts are
|
|
122
|
+
preserved for operator inspection. Later synchronization and the final Pages verifier fail closed
|
|
123
|
+
until those artifacts (or a leftover `.wasm-debug.sync.lock*`) are manually inspected and resolved;
|
|
124
|
+
they are never silently deleted or published. This build-time preparation does not change lazy browser loading:
|
|
125
|
+
clients fetch the debugger payload only when a supported debug session starts. If the LLDB manifest
|
|
126
|
+
is absent, invalid, or does not advertise
|
|
127
|
+
the required breakpoint/step/stack/local capabilities, the
|
|
128
|
+
playground labels that run as a trace fallback and keeps the existing instrumentation debugger
|
|
129
|
+
available. LLDB-designated browser fixtures reject trace fallback, while a separate missing-asset
|
|
130
|
+
fixture qualifies the pre-session trace alternative. Build and verify both producers
|
|
131
|
+
using [`producer/lldb-browser`](../wasm-llvm/producer/lldb-browser) and
|
|
132
|
+
[`producer/wamr-browser`](../wasm-llvm/producer/wamr-browser), then assemble them with the Clang
|
|
133
|
+
release:
|
|
134
|
+
|
|
135
|
+
Stable v1 is release-qualified on 64-bit desktop Chromium on Linux. It supports one active debug
|
|
136
|
+
session for `wasm32-wasi` Preview 1 C/C++ and `wasm32-wasip1` Rust artifacts produced by the
|
|
137
|
+
pinned toolchains at `-O0` with embedded DWARF. Debug starts a new, single-threaded WAMR classic
|
|
138
|
+
interpreter instance; it does not attach to a browser-engine run or preserve that run's live state,
|
|
139
|
+
and runtime-specific behavior can differ. Trace fallback is selected only before an LLDB session is
|
|
140
|
+
established; an LLDB or WAMR failure ends that session instead of silently changing debugger
|
|
141
|
+
semantics.
|
|
142
|
+
|
|
143
|
+
Stable v2 inherits that exact release boundary: 64-bit desktop Chromium on Linux, a
|
|
144
|
+
cross-origin-isolated deployment, one active session, pinned C/C++ and `wasm32-wasip1` Rust
|
|
145
|
+
producer artifacts at `-O0` with embedded DWARF, and a new WAMR debug execution rather than an
|
|
146
|
+
attachment to an existing browser-engine run. DAP is an internal product protocol boundary; v2
|
|
147
|
+
does not claim compatibility with arbitrary third-party DAP clients or arbitrary externally
|
|
148
|
+
produced Wasm/DWARF artifacts.
|
|
149
|
+
|
|
150
|
+
Pause is bounded but is not guaranteed to yield an inspectable stop while WAMR is blocked in a
|
|
151
|
+
synchronous host call. In particular, a synchronous WAMR stdin read may time out instead of
|
|
152
|
+
producing an inspectable pause. After that explicit timeout, **Stop Debug** still performs bounded
|
|
153
|
+
Worker cleanup and permits a fresh debug execution; the session never remains indefinitely pending.
|
|
154
|
+
|
|
155
|
+
Stable v2 adds bounded variable-path watches and a paused-target memory inspector.
|
|
156
|
+
Watch fallback accepts identifiers, nested fields, and non-negative indexes without enabling general
|
|
157
|
+
expression evaluation. The memory panel can select a variable's DAP `memoryReference`, reads at most
|
|
158
|
+
256 bytes per request, pages by the selected byte count, renders hexadecimal/ASCII data and unreadable
|
|
159
|
+
bytes as `??`, and discards a response when the target resumes or the selected frame changes. While
|
|
160
|
+
paused, it also accepts 1–256 two-digit hexadecimal bytes for a raw target-memory write and refreshes
|
|
161
|
+
the displayed range after a successful write. This edits memory only; it does not provide typed
|
|
162
|
+
`setVariable` semantics, validate that a value is safe for the guest, or preserve the mutation after
|
|
163
|
+
restart. The complete UI write path is qualified in real Chromium with `wasm32-wasi` C/C++ and
|
|
164
|
+
`wasm32-wasip1` Rust programs.
|
|
165
|
+
While paused, the same panel can install one session-scoped LLDB data breakpoint over a 1–256 byte
|
|
166
|
+
memory range. The browser gate qualifies `wasm32-wasi` C write, C++ read/write, and
|
|
167
|
+
`wasm32-wasip1` Rust read access. Setting a new data breakpoint replaces the previous set, and
|
|
168
|
+
**Clear** sends an empty replacement set to the target. Its opaque DAP data ID is never persisted
|
|
169
|
+
across restart or a new debug execution. Because WAMR reports a completed memory access, the stopped
|
|
170
|
+
source location can be the next executable line after the watched instruction.
|
|
171
|
+
If a replacement or clear request times out, is rejected, or returns malformed DAP data, the debug
|
|
172
|
+
execution stops and disposes both Workers so the UI cannot continue with an uncertain watchpoint
|
|
173
|
+
set; **Restart Debug** then starts a clean execution. A successful but unverified replacement remains
|
|
174
|
+
nonfatal and is reported as unverified.
|
|
175
|
+
The Chromium qualification includes an indexed one-byte watched subrange that overlaps a four-byte scalar store.
|
|
176
|
+
LLDB uses modify semantics for write mode: a write data breakpoint stops when at least one watched byte changes;
|
|
177
|
+
a same-value store is reported by WAMR but automatically resumed by LLDB.
|
|
178
|
+
Data breakpoints cover scalar classic-interpreter loads and stores only.
|
|
179
|
+
Bulk-memory operations and host-side memory writes do not trigger data breakpoints; guest threads
|
|
180
|
+
and memories outside the supported linear-memory configuration remain out of scope. Trace fallback
|
|
181
|
+
does not advertise or emulate data breakpoints.
|
|
182
|
+
The v2 **Restart Debug** action fully disposes the active LLDB and WAMR Workers, waits for the old
|
|
183
|
+
execution to settle, and launches a fresh debug execution from the current workspace. It does not
|
|
184
|
+
preserve target state or advertise the DAP `restart` capability.
|
|
185
|
+
|
|
186
|
+
Full expression evaluation, conditional/log breakpoints, typed variable mutation through DAP
|
|
187
|
+
`setVariable`, DAP in-session restart, standalone terminate, optimized-debug guarantees, C++
|
|
188
|
+
exception support, STL pretty-printers, `wasm64`, guest threads, reverse debugging, SIMD,
|
|
189
|
+
multi-module guests, and Rust WASI Preview 2/3 debugging remain outside the supported boundary.
|
|
190
|
+
|
|
191
|
+
```sh
|
|
192
|
+
cd ../wasm-llvm
|
|
193
|
+
WASM_LLVM_LLDB_ARTIFACT_DIR=/path/to/lldb-artifacts \
|
|
194
|
+
WASM_LLVM_WAMR_ARTIFACT_DIR=/path/to/wamr-artifacts \
|
|
195
|
+
pnpm prepare:clang-release
|
|
6
196
|
|
|
7
|
-
|
|
197
|
+
cd ../wasm-idle
|
|
198
|
+
WASM_RUST_PRODUCER_OUTPUT_ROOT=/path/to/rust-producer-output \
|
|
199
|
+
pnpm --dir runtimes/wasm-rust build:producer
|
|
200
|
+
pnpm sync:wasm-rust
|
|
201
|
+
pnpm sync:wasm-debug ../wasm-llvm/out/clang-browser
|
|
202
|
+
WASM_IDLE_BROWSER_SERVER_MODE=dev pnpm test:browser:debug:lldb
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
The synchronized manifest rejects missing hashes, incompatible Clang/LLDB revisions, and stale
|
|
206
|
+
worker sidecars. The strict browser test covers real C, C++, and Rust breakpoint, step, output, and
|
|
207
|
+
termination paths and rejects trace fallback or a missing debug asset. The Rust producer build is
|
|
208
|
+
required for LLDB metadata; the historical split-runtime build intentionally lacks exact compiler
|
|
209
|
+
provenance and is rejected instead of starting a potentially incompatible debugger.
|
|
210
|
+
|
|
211
|
+
### Runtime details
|
|
212
|
+
|
|
213
|
+
`Package/version base` names the deployed static module or manifest and its producer package,
|
|
214
|
+
or the browser-side package/workspace runtime that backs each row. Static ESM entries are page
|
|
215
|
+
assets loaded over HTTP on demand, not files embedded in the published npm packages.
|
|
216
|
+
`Execution defaults / flags` lists the default
|
|
217
|
+
targets and flags wasm-idle applies, plus the public per-run options that change execution.
|
|
218
|
+
`Customization` lists the `runtimeAssets` fields and matching `PUBLIC_WASM_*` env overrides
|
|
219
|
+
when they exist.
|
|
220
|
+
|
|
221
|
+
| Language / IDs | Package/version base | Execution defaults / flags | Customization |
|
|
222
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
223
|
+
| C3<br>`C3` | wasm-llvm/c3-browser: C3 0.8.3 / LLVM 22.1.8 | Verified c3c and builtin LLD compile real C3 in a fresh browser Worker; UTF-8 env.readByte/env.writeByte ABI and exported main; std::io and WASI unavailable | `runtimeAssets.c3.baseUrl`, `stdin`, `activePath`, `workspaceFiles`; fixed compiler flags and bounded Wasm memories |
|
|
224
|
+
| C<br>`C` | @wasm-idle/llvm-core@1.0.0 / Clang 22.1.8 WASI sysroot from the `wasm-llvm` producer | `clang` for `wasm32-wasi`; default `-std=gnu11`; LLDB mode compiles untouched source with embedded DWARF at `-g -O0` and runs it in WAMR; normal runs still use the browser WASI host; supports `stdin` and `programArgs` | `runtimeAssets.clang.baseUrl`/`loader` or `rootUrl`; `compileArgs`, `programArgs`, `cVersion`, `activePath`, `workspaceFiles`, `debugMode`, `breakpoints`, `pauseOnEntry` |
|
|
225
|
+
| C++<br>`CPP` | @wasm-idle/llvm-core@1.0.0 / Clang 22.1.8 WASI sysroot from the `wasm-llvm` producer | `clang++` for `wasm32-wasi`; default `-std=gnu++20`; LLDB mode compiles untouched source with embedded DWARF at `-g -O0` and runs it in WAMR; normal runs still use the browser WASI host; supports `stdin` and `programArgs` | `runtimeAssets.clang.baseUrl`/`loader` or `rootUrl`; `compileArgs`, `programArgs`, `cppVersion`, `activePath`, `workspaceFiles`, `debugMode`, `breakpoints`, `pauseOnEntry` |
|
|
226
|
+
| Objective-C<br>`OBJC` | GNUstep libobjc2 v2.3 assets from the `wasm-llvm` producer + @wasm-idle/llvm-core@1.0.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`/`.mm`/`.c` workspace files; 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` |
|
|
227
|
+
| Python<br>`PYTHON3` | 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` |
|
|
228
|
+
| 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` |
|
|
229
|
+
| 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; exact rustc/LLVM provenance is recorded for LLDB compatibility | browser host `wasm32-wasip1-threads`; default target `wasm32-wasip1`, selectable `wasm32-wasip1`, `wasm32-wasip2`, `wasm32-wasip3`; LLDB mode is currently limited to `wasm32-wasip1` and emits embedded DWARF with `-C debuginfo=2 -C opt-level=0`; normal Preview 1/2/3 execution remains unchanged; supports `stdin` and `programArgs` | `runtimeAssets.rust.compilerUrl`, `runtimeAssets.rust.debugModuleUrl`, or `PUBLIC_WASM_RUST_COMPILER_URL`; `rootUrl`, `rustTargetTriple`, `programArgs`, `debugMode`; compiler requests accept `edition`, `crateType`, `extendedTimeout`, `log`, and `onProgress`; runtime manifest controls compiler memory, timeout, and shared workspace size |
|
|
230
|
+
| 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` |
|
|
231
|
+
| 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` |
|
|
232
|
+
| 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 |
|
|
233
|
+
| 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 |
|
|
234
|
+
| 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 |
|
|
235
|
+
| 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` |
|
|
236
|
+
| 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 |
|
|
237
|
+
| 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` |
|
|
238
|
+
| 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` |
|
|
239
|
+
| Perl<br>`PERL` | WebPerl v0.09-beta (webperl_prebuilt_v0.09-beta.zip) | host-verifies the manifest, stored assets, logical hashes, and profile-bound one-shot runner before executing `emperl`; supports `stdin` and `programArgs` | explicit `runtimeAssets.perl.baseUrl`/`workerUrl`/`manifestUrl` overrides require one complete profile-and-runner receipt bundle; URL-only `PUBLIC_WASM_PERL_*` overrides fail closed; `programArgs`, `activePath`, `workspaceFiles` |
|
|
240
|
+
| Tcl<br>`TCL` | Wacl Tcl 2017-05-29 (wacl.zip) | host-verifies the manifest, stored assets, logical hashes, and profile-bound one-shot runner before executing Wacl Tcl; supports `stdin` and `programArgs` | bundled mirrors may set `runtimeAssets.tcl.baseUrl`/`workerUrl`/`manifestUrl` or `PUBLIC_WASM_TCL_BASE_URL`/`PUBLIC_WASM_TCL_WORKER_URL`; custom executable bytes require one complete profile-and-runner receipt bundle; `programArgs`, `activePath`, `workspaceFiles` |
|
|
241
|
+
| 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` |
|
|
242
|
+
| 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` |
|
|
243
|
+
| 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` |
|
|
244
|
+
| 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` |
|
|
245
|
+
| 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` |
|
|
246
|
+
| Janet<br>`JANET` | Janet 1.41.3-dev / Emscripten 3.1.8 opaque vendored bundle | host-verifies the manifest, stored assets, logical hashes, and profile-bound one-shot runner before executing the Janet VM; supports `stdin` and `programArgs` | explicit `runtimeAssets.janet.baseUrl`/`workerUrl`/`manifestUrl` overrides require one complete profile-and-runner receipt bundle; URL-only `PUBLIC_WASM_JANET_*` overrides fail closed; `programArgs`, `activePath`, `workspaceFiles` |
|
|
247
|
+
| Julia<br>`JULIA` | @chriskoch/julia-wasm@1.0.4 | host-verifies the manifest, stored assets, logical hashes, and profile-bound one-shot runner before executing the legacy Julia VM; supports `stdin` and `activePath` | explicit `runtimeAssets.julia.baseUrl`/`workerUrl`/`manifestUrl` overrides require one complete profile-and-runner receipt bundle; URL-only `PUBLIC_WASM_JULIA_*` overrides fail closed; `activePath` |
|
|
248
|
+
| Nim<br>`NIM` | Nim 2.2.4 / benagastov Nim-WASM-Compiler with clang/lld WASM | host-verifies the manifest, eight stored assets, logical hashes, and profile-bound one-shot runner before compiling Nim to C and linking with clang/lld WASM in a disposable worker; supports `stdin`, `programArgs`, and `activePath` | explicit `runtimeAssets.nim.baseUrl`/`workerUrl`/`manifestUrl` overrides require one complete profile-and-runner receipt bundle; URL-only `PUBLIC_WASM_NIM_*` overrides fail closed; `programArgs`, `activePath` |
|
|
249
|
+
| Bash<br>`BASH` | @wasm-idle/runtime-bash@0.1.0 / GNU Bash WASIX + receipt-pinned @wasmer/sdk@0.9.0 profile | host-verifies one profile manifest, the stored SDK JavaScript, Wasmer Wasm, and WEBc before starting a fixed worker generation with no runtime-asset fetches; invokes `bash -c <code> <activePath> ...programArgs` and supports `stdin`, `programArgs`, `activePath`, and `workspaceFiles` | `rootUrl` mirrors reuse the bundled profile; explicit `runtimeAssets.bash.baseUrl`/`manifestUrl`/`moduleUrl`/`wasmerWasmUrl`/`webcUrl` overrides require one complete profile; `workerUrl` is rejected; `stdin`, `programArgs`, `activePath`, `workspaceFiles` |
|
|
250
|
+
| 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` |
|
|
251
|
+
| TinyGo<br>`TINYGO` | wasm-tinygo@0.0.0 / upstream TinyGo 0.40.1 browser toolchain | receipt-verifies and runs upstream `cmd/go` plus TinyGo in a disposable capped Worker; targets `wasip1`; supports `stdin`, `programArgs`, `workspaceFiles`, hosted C++ without exceptions/RTTI, and offline `vendor/modules.txt` | `runtimeAssets.tinygo.moduleUrl`/`assetLoader`; `PUBLIC_WASM_TINYGO_MODULE_URL`, execution/workspace resource limits, `programArgs` |
|
|
252
|
+
| 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`; outer module and manifest are size/SHA-256 verified before use | `runtimeAssets.ocaml.moduleUrl`/`manifestUrl` plus `moduleReceipt`/`manifestReceipt` for a custom generation, or `PUBLIC_WASM_OCAML_*` for a mirror of the bundled generation; `ocamlBackend` |
|
|
253
|
+
| 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` |
|
|
254
|
+
| 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` |
|
|
255
|
+
| 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` |
|
|
256
|
+
| 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` |
|
|
257
|
+
| 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` |
|
|
258
|
+
| 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` |
|
|
259
|
+
| 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` |
|
|
260
|
+
| Scheme<br>`LISP` | wasm-lisp@0.1.0 / Puppy Scheme WASM component | receipt-verified Puppy Scheme compiler/runtime; supports `stdin` and `programArgs` | `runtimeAssets.lisp.{moduleUrl,manifestUrl,manifestFingerprint}` or `PUBLIC_WASM_LISP_{MODULE_URL,MANIFEST_URL,MANIFEST_FINGERPRINT}`; `programArgs` |
|
|
261
|
+
| Ruby<br>`RUBY` | receipt-pinned `static/wasm-ruby` profile produced from @ruby/3.4-wasm-wasi@2.9.3-2.9.4 + @ruby/wasm-wasi@2.9.3-2.9.4 | host-verifies the manifest, canonical stored module and gzip bytes, and logical WASM before transferring three owned buffers to a no-fetch CRuby 3.4 worker; supports `stdin`, `programArgs`, and workspace files | `rootUrl` mirrors reuse the bundled profile; explicit `runtimeAssets.ruby` overrides require one complete profile and same-origin canonical paths; URL-only `PUBLIC_WASM_RUBY_*` overrides fail closed; `stdin`, `programArgs`, `workspaceFiles` |
|
|
262
|
+
| 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` |
|
|
263
|
+
| LFortran<br>`LFORTRAN` | receipt-pinned `wasm-llvm/producer/lfortran-browser` artifacts in `static/wasm-lfortran` | real LFortran 0.65.0-97-gab867a23 LLVM evaluator compiles and executes Emscripten side modules in a fresh Worker; shared-ring stdin supports delayed READ and EOF; experimental Fortran feature coverage | `runtimeAssets.lfortran.baseUrl` relocates the reviewed bundle; `stdin`, `activePath`, workspace data/include files, cancellation and execution limits; no program arguments or multi-file module build orchestration |
|
|
264
|
+
| Fortran<br>`FORTRAN` | Netlib f2c 2022-09-09 + `@cowasm/f2c 1.0.0` libf2c + @wasm-idle/llvm-core@1.0.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` |
|
|
265
|
+
| COBOL<br>`COBOL` | GnuCOBOL 3.2 + GMP 6.3.0 assets from the `wasm-llvm` producer + @wasm-idle/llvm-core@1.0.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` |
|
|
266
|
+
| 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` |
|
|
267
|
+
| 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_*` |
|
|
268
|
+
| 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` |
|
|
269
|
+
| 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` |
|
|
270
|
+
| 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` |
|
|
271
|
+
|
|
272
|
+
### Blocked candidates
|
|
273
|
+
|
|
274
|
+
These languages are intentionally not part of the execution support matrix yet. They should stay
|
|
275
|
+
out of `supportedLanguages` until the blocker is resolved with a real browser runtime/compiler and
|
|
276
|
+
stdin/stdout coverage.
|
|
277
|
+
|
|
278
|
+
| Candidate | Candidate IDs | Current evidence | Blocker | Required follow-up |
|
|
279
|
+
| -------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
280
|
+
| Odin | `ODIN` | [Pinned native WASI baseline](https://github.com/seo-rii/wasm-llvm/pull/2) compiles real multi-file Odin and passes stdin, EOF and nonzero-exit cases; the consumer target probe exercises the production WASM Worker | The compiler-host Emscripten probe fails in upstream gb.h on unsupported OS/CPU definitions and missing sys/sendfile.h; no browser-hosted Odin compiler exists in the bundle | [Complete the compiler host port and consumer acceptance](docs/language-ports/odin.md) before registering ODIN; native target execution does not enable source compilation |
|
|
281
|
+
| 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 |
|
|
282
|
+
| Crystal | `CRYSTAL` | [Pinned Crystal 1.21.0 producer](https://github.com/seo-rii/wasm-llvm/pull/3) emits a real WASI object; the consumer probe links that target with verified WASI libc and exercises standard input and EOF in the production WASM Worker | Cross-compiling the compiler fails at Crystal::System::Process.prepare_args in the upstream WASI process implementation; no browser-hosted Crystal compiler bundle is available | [Implement the compiler host and consumer source-execution contract](docs/language-ports/crystal.md) before registering CRYSTAL; a native object or linked target does not establish browser compilation |
|
|
283
|
+
| Swift | `SWIFT` | Native Swift 6.3.3 and the full Wasm SDK produce a target that passes Chromium stdin/UTF-8/EOF checks through the production WASM worker with explicit and shared-buffer input; browser-hosted swiftc/SwiftPM assets remain unavailable | Target execution evidence does not supply a browser-hosted real Swift compiler or SwiftPM; SWIFT remains unregistered | Produce a browser-hosted Swift compiler/SwiftPM bundle and pass source compilation, diagnostics, arguments, and workspace contracts before registering SWIFT |
|
|
284
|
+
|
|
285
|
+
## Monorepo layout
|
|
286
|
+
|
|
287
|
+
`wasm-idle` is managed as a pnpm workspace. Language-independent app code remains here while large
|
|
288
|
+
toolchains can be consumed from pinned external runtime repositories:
|
|
289
|
+
|
|
290
|
+
- `packages/core`: framework-neutral contracts, runtime asset keys, progress helpers, and playground
|
|
291
|
+
binding helpers.
|
|
292
|
+
- `packages/debug`: optional debug session controller, language adapters, expression helpers, and
|
|
293
|
+
Monaco integration built on the contracts from `@wasm-idle/core`.
|
|
294
|
+
- `packages/llvm-core`: code-only browser hosts for shared memory, MemFS, tar, WASI, Clang, COBOL,
|
|
295
|
+
and Objective-C execution. Every compiler, sysroot, archive, and worker asset is supplied through
|
|
296
|
+
an explicit HTTP(S) URL.
|
|
297
|
+
- `packages/lsp`: code-only browser language-server hosts. TypeScript libraries, SQL engines,
|
|
298
|
+
clangd, and other language-tool assets are supplied through explicit runtime URLs.
|
|
299
|
+
- [`seo-rii/wasm-llvm`](https://github.com/seo-rii/wasm-llvm): external producer repository for compiler source pins, patches, reproducible builds,
|
|
300
|
+
manifests, and asset verification. Its `producer/rust-browser` source build owns the current Rust
|
|
301
|
+
1.99 compiler, matching LLVM 22 code generator, and in-process LLD; it is not consumed as an npm
|
|
302
|
+
runtime package.
|
|
303
|
+
- `packages/svelte`: Svelte store/binding helpers around `@wasm-idle/core`.
|
|
304
|
+
- `packages/terminal`: optional Svelte/xterm terminal UI that consumes an injected playground
|
|
305
|
+
binding without adding browser UI dependencies to the root runtime package.
|
|
306
|
+
- `packages/react`: React hooks around `@wasm-idle/core`.
|
|
307
|
+
- `packages/vue`: Vue composables around `@wasm-idle/core`.
|
|
308
|
+
- `packages/node`: Node.js host helpers for Node-capable sandbox loaders.
|
|
309
|
+
- `runtimes/*`: imported runtime/compiler packages such as `wasm-rust`,
|
|
310
|
+
`wasm-of-js-of-ocaml`, `wasm-go`, `wasm-dotnet`, `wasm-typescript`,
|
|
311
|
+
`wasm-wat`, `wasm-lua`, `wasm-lisp`, `wasm-elixir`, `wasm-tcl`, `wasm-awk`,
|
|
312
|
+
`wasm-forth`, `wasm-j`, `wasm-bqn`, `wasm-janet`,
|
|
313
|
+
`pyodide`, `teavm`, `assemblyscript`, `ruby`, `r`, and `js-sandbox`.
|
|
314
|
+
- `runtimes/wasm-tinygo`: the public `TINYGO` browser compiler consumer plus an explicitly labeled
|
|
315
|
+
legacy AST-to-C development harness. Static releases publish only the receipt-verified upstream
|
|
316
|
+
consumer and its source-pinned toolchain assets.
|
|
317
|
+
- `producers/wasm-php`: standalone, locked producer for the checked-in PHP 8.4 page asset. It is
|
|
318
|
+
outside the root workspace and is never published as an npm package.
|
|
319
|
+
- `static/wasm-zig`, `static/wasm-haskell`, `static/wasm-julia`, and `static/wasm-nim`: bundled browser runtime and
|
|
320
|
+
compiler assets synced from
|
|
321
|
+
upstream asset builds rather than local workspace packages.
|
|
322
|
+
- `tools/*`: migrated local toolchain projects that are too broad or infrastructure-heavy to run as
|
|
323
|
+
normal runtime workspace packages. `tools/dool` contains the Docker judge backend for Elixir and
|
|
324
|
+
the other server-side language runners.
|
|
325
|
+
|
|
326
|
+
Useful workspace commands:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
pnpm workspace:list
|
|
330
|
+
pnpm build:packages
|
|
331
|
+
pnpm check:packages
|
|
332
|
+
pnpm build:runtimes
|
|
333
|
+
pnpm check:runtimes
|
|
334
|
+
pnpm sync:runtime list
|
|
335
|
+
pnpm sync:runtimes
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
The runtime sync scripts default to `runtimes/<name>/dist`; optional source and target arguments are
|
|
339
|
+
for alternate build directories inside the current checkout. PHP is the exception:
|
|
340
|
+
`sync:wasm-php` consumes `producers/wasm-php/dist` or `WASM_IDLE_WASM_PHP_DIST`.
|
|
341
|
+
|
|
342
|
+
Published packages are built in workspace dependency order. Before publishing, run:
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
pnpm verify:package
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
The smoke check packs the root library and its public workspace dependencies, installs the tarballs
|
|
349
|
+
into a temporary project, and imports each public entry point.
|
|
350
|
+
|
|
351
|
+
Package-backed browser runtimes are converted into page-owned static ESM assets with:
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
pnpm run build:static-runtime-modules
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
This producer step writes `runtime.mjs` trees under `static/wasm-assemblyscript/`,
|
|
358
|
+
`static/wasm-duckdb/`, `static/wasm-ruby/`, and `static/wasm-sqlite/`. It also writes the Wasmer SDK
|
|
359
|
+
compatibility files and the unified Bash runtime profile under `static/wasm-bash/` through the same
|
|
360
|
+
rollback-capable Bash producer used by `sync:wasm-bash`. The browser consumes only the profile's
|
|
361
|
+
opaque, receipt-pinned storage paths; these files are deployed page assets, not npm package
|
|
362
|
+
contents.
|
|
363
|
+
|
|
364
|
+
PHP is built independently under `producers/wasm-php`, with its own lockfile and exact
|
|
365
|
+
`@php-wasm/web-8-4@3.1.34` and `@php-wasm/universal@3.1.34` dependencies. Refresh the checked-in
|
|
366
|
+
page asset only when changing that producer:
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
pnpm --dir producers/wasm-php install --frozen-lockfile
|
|
370
|
+
pnpm --dir producers/wasm-php build
|
|
371
|
+
pnpm --dir producers/wasm-php verify
|
|
372
|
+
pnpm run sync:wasm-php
|
|
373
|
+
pnpm run build:static-runtime-modules
|
|
374
|
+
pnpm run compress:static-runtimes
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
`build:static-runtime-modules` regenerates the shared module cache key after the PHP manifest
|
|
378
|
+
changes, but validates rather than rebuilds PHP. `page:build` neither installs nor bundles PHP
|
|
379
|
+
packages; it validates the manifest, logical byte sizes, and SHA-256 hashes of the checked-in
|
|
380
|
+
`static/wasm-php/` output before consuming it. The runtime exposes PHP 8.4 only; there is no runtime
|
|
381
|
+
PHP version selector.
|
|
8
382
|
|
|
9
383
|
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
384
|
|
|
11
|
-
Pyodide core assets are
|
|
12
|
-
package with:
|
|
385
|
+
Pyodide's `pyodide.mjs` and core assets are served from `static/pyodide/` and loaded on demand by
|
|
386
|
+
both Python execution and Python LSP workers. Refresh them after bumping the `pyodide` package with:
|
|
13
387
|
|
|
14
388
|
```bash
|
|
15
389
|
cd wasm-idle
|
|
16
390
|
pnpm run sync:pyodide
|
|
17
391
|
```
|
|
18
392
|
|
|
19
|
-
|
|
393
|
+
WebR's browser ESM entry `webr.js` and runtime files are served from a fingerprinted directory under
|
|
394
|
+
`static/webr/`. R execution and R LSP workers share that static asset tree. Refresh it after
|
|
395
|
+
bumping `webr` with:
|
|
20
396
|
|
|
21
|
-
|
|
397
|
+
```bash
|
|
398
|
+
cd wasm-idle
|
|
399
|
+
pnpm run sync:webr
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Elixir and Erlang browser execution use an AtomVM/Popcorn AVM bundle. The Popcorn `eval-in-wasm`
|
|
403
|
+
source and vendored Popcorn Elixir build dependency now live under `runtimes/wasm-elixir/`;
|
|
404
|
+
rebuild and sync with:
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
cd wasm-idle
|
|
408
|
+
pnpm --dir runtimes/wasm-elixir run bundle
|
|
409
|
+
pnpm run sync:wasm-elixir
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
Erlang support uses Popcorn's upstream `eval_erlang` and `eval_erlang_module` paths. This is not a
|
|
413
|
+
handwritten wasm-idle subset, but it inherits AtomVM/Popcorn runtime limits and is not full
|
|
414
|
+
Erlang/OTP ERTS coverage. Some OTP paths that rely on missing NIFs can fail in the current bundle,
|
|
415
|
+
so the browser starter and stdin coverage use `io:get_line`/`io:format` only.
|
|
416
|
+
|
|
417
|
+
Julia browser execution uses the `@chriskoch/julia-wasm@1.0.4` asset bundle under
|
|
418
|
+
`static/wasm-julia/`. Despite the package and bundled README version, the verified runtime reports
|
|
419
|
+
`VERSION == v"1.3.0-DEV.560"`; wasm-idle therefore labels it as a legacy development runtime.
|
|
420
|
+
Refresh the vendored worker/runtime assets with:
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
cd wasm-idle
|
|
424
|
+
pnpm run sync:wasm-julia
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
Nim browser execution uses the `benagastov/Nim-WASM-Compiler` asset pipeline under
|
|
428
|
+
`static/wasm-nim/`: Nim 2.2.4 compiled to WebAssembly emits C, then bundled clang/lld WebAssembly
|
|
429
|
+
assets link a runnable WASI module. Refresh the vendored worker/runtime assets with:
|
|
22
430
|
|
|
23
431
|
```bash
|
|
24
432
|
cd wasm-idle
|
|
433
|
+
pnpm run sync:wasm-nim
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
## Rust browser integration
|
|
437
|
+
|
|
438
|
+
The demo app publishes the workspace `wasm-rust` compiler as a receipt-pinned executable graph
|
|
439
|
+
under `static/wasm-rust/`. The example `Terminal` uses `/wasm-rust/index.js` as the graph's logical
|
|
440
|
+
base URL; that logical JavaScript path is never fetched or imported. Verified module bytes are
|
|
441
|
+
served from inert `.js.bin`/`.js.gz.bin` storage and execute only through owned Blob URLs. Refresh
|
|
442
|
+
the receipts for the checked static publication with the command below. Publication removes raw or
|
|
443
|
+
precompressed JavaScript outside the verified graph; the separately scoped debug instrumenter is
|
|
444
|
+
the only explicit raw-JavaScript allowlist.
|
|
445
|
+
|
|
446
|
+
```bash
|
|
25
447
|
pnpm run sync:wasm-rust
|
|
26
448
|
```
|
|
27
449
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
450
|
+
Publishing a newly built producer dist is an explicit operation and succeeds only when both graph
|
|
451
|
+
authorities match `scripts/wasm-rust-assets.lock.json`. It replaces the complete published runtime
|
|
452
|
+
tree, including WASI sysroot/link packs, so first verify that the producer dist contains the exact
|
|
453
|
+
pack generation intended for publication:
|
|
454
|
+
|
|
455
|
+
```bash
|
|
456
|
+
pnpm --dir runtimes/wasm-rust build
|
|
457
|
+
pnpm run sync:wasm-rust -- runtimes/wasm-rust/dist
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
The built-in Rust route supports `wasm32-wasip1`, `wasm32-wasip2`, and `wasm32-wasip3`. The page
|
|
461
|
+
exposes a target selector when Rust is active, defaults to `wasm32-wasip1`, and persists that choice
|
|
462
|
+
in local storage. The compiler module, rustc, sysroot, and component tooling remain unloaded until
|
|
463
|
+
Rust is selected; LSP assets remain unloaded until the LSP toggle is enabled.
|
|
31
464
|
|
|
32
465
|
## TinyGo browser integration
|
|
33
466
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
467
|
+
`TINYGO` is a public `wasip1` playground language backed by the independent `upstream.js`
|
|
468
|
+
consumer. It never falls back to wasm-idle's older Go AST-to-C porting harness: the static sync
|
|
469
|
+
allowlist excludes `runtime.js`, its runtime chunks, emception, and the legacy compiler payload.
|
|
470
|
+
The legacy code remains in `runtimes/wasm-tinygo` only for local compiler-port development and is
|
|
471
|
+
explicitly classified as `wasm-idle-go-ast-to-c-subset`.
|
|
472
|
+
|
|
473
|
+
The sibling `wasm-llvm/producer/tinygo-browser` producer pins upstream TinyGo 0.40.1, go-llvm,
|
|
474
|
+
TinyGo LLVM 20.1.1, Go 1.24.6, and WASI SDK 33. The public consumer hash-verifies both producer
|
|
475
|
+
receipts, the upstream compiler, reduced TinyGo/Go root, `cmd/go` WASI package-graph provider, and
|
|
476
|
+
raw LLD before compiling. It derives package JSON from the supplied module workspace, validates
|
|
477
|
+
every compiler/link-plan handoff, links with raw LLD, and finalizes with pinned Binaryen 129.
|
|
478
|
+
|
|
479
|
+
Compile protocol v6 covers generated `go:embed` objects, CGo C, hosted libc++/libc++abi C++17
|
|
480
|
+
without exceptions/RTTI/global constructors, preprocessed Clang assembly, exact allowed
|
|
481
|
+
`CXXFLAGS`, and restricted `#cgo LDFLAGS`. Offline external modules require a complete
|
|
482
|
+
`vendor/modules.txt` tree; there is no network module fallback. Package-graph and compile work run
|
|
483
|
+
inside disposable Workers with fail-closed phase deadlines and a capped WebAssembly memory
|
|
484
|
+
declaration. Separate producer and consumer fixtures cover maps, slices, structs, methods,
|
|
485
|
+
interfaces, generics, package initialization, goroutines, channels, stdin, CGo, C++, and assembly.
|
|
486
|
+
Go/Plan 9 assembly is still not loaded by upstream TinyGo 0.40.1 and is documented as an upstream
|
|
487
|
+
limitation rather than emulated by a browser-only subset.
|
|
488
|
+
|
|
489
|
+
Prepare a verified asset directory, build the runtime, and publish the upstream-only static tree
|
|
490
|
+
with:
|
|
42
491
|
|
|
43
492
|
```bash
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
493
|
+
pnpm --dir runtimes/wasm-tinygo prepare:wasm-llvm-upstream -- \
|
|
494
|
+
--compiler /path/to/tinygo-compiler.wasm \
|
|
495
|
+
--root-archive /path/to/tinygoroot.tar.gz \
|
|
496
|
+
--producer-receipt /path/to/producer-receipt.json \
|
|
497
|
+
--package-graph /path/to/tinygo-package-graph.wasm \
|
|
498
|
+
--package-graph-receipt /path/to/package-graph-provider-receipt.json \
|
|
499
|
+
--lld /path/to/lld.wasm \
|
|
500
|
+
--output-dir public/tools/upstream
|
|
501
|
+
pnpm --dir runtimes/wasm-tinygo build:upstream
|
|
48
502
|
pnpm run sync:wasm-tinygo
|
|
49
503
|
```
|
|
50
504
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
505
|
+
`PUBLIC_WASM_TINYGO_MODULE_URL` or `runtimeAssets.tinygo.moduleUrl` may point at a separately hosted
|
|
506
|
+
`upstream.js`; its sibling chunks and `tools/upstream/` assets must be served from the same relative
|
|
507
|
+
tree. `PUBLIC_WASM_TINYGO_APP_URL` remains a compatibility alias used only to derive that module
|
|
508
|
+
URL. Custom hosts may provide `runtimeAssets.tinygo.assetLoader`, while normal execution and
|
|
509
|
+
workspace limits continue to apply.
|
|
510
|
+
|
|
511
|
+
## C# / F# / VB.NET / .NET browser integration
|
|
512
|
+
|
|
513
|
+
The demo app vendors the workspace `wasm-dotnet` browser module under `static/wasm-dotnet/` and exposes
|
|
514
|
+
C# as `CSHARP`, F# as `FSHARP`, and VB.NET as `VBNET` in the shared playground selector. Refresh the
|
|
515
|
+
browser module after rebuilding the workspace project with:
|
|
516
|
+
|
|
517
|
+
```bash
|
|
518
|
+
pnpm --dir runtimes/wasm-dotnet build
|
|
519
|
+
dotnet workload install wasm-tools
|
|
520
|
+
dotnet workload install wasm-experimental
|
|
521
|
+
pnpm --dir runtimes/wasm-dotnet build:runtime
|
|
522
|
+
pnpm run sync:wasm-dotnet
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
C#, F#, and VB.NET compile in the browser through separate .NET `browser-wasm` AOT bundles at
|
|
526
|
+
`runtime/csharp/`, `runtime/fsharp/`, and `runtime/vbnet/`. `wasm-idle` loads the static
|
|
527
|
+
`wasm-dotnet` module only after a .NET language is selected; the module then loads only that
|
|
528
|
+
language's `dotnet.js` and filtered shared reference assemblies. No server-side dotnet compile route
|
|
529
|
+
is involved. For a hosted app, pass `runtimeAssets.dotnet.moduleUrl` or set
|
|
530
|
+
`PUBLIC_WASM_DOTNET_MODULE_URL`. The browser path forwards CLI args and buffered terminal stdin into
|
|
531
|
+
`Console.In`. Roslyn C#, FSharp.Compiler.Service, and Roslyn Visual Basic hot paths are selectively
|
|
532
|
+
AOT compiled in their respective bundles. Monaco diagnostics reuse the selected threaded runtime
|
|
533
|
+
through an in-process `MessageChannel` transport because the .NET pthread runtime must start on the
|
|
534
|
+
browser UI thread.
|
|
61
535
|
|
|
62
536
|
## Browser regression commands
|
|
63
537
|
|
|
64
|
-
|
|
538
|
+
C3 local asset setup, byte I/O ABI, and its 1 GiB default memory budget are documented in
|
|
539
|
+
[C3 browser integration](docs/c3-browser.md).
|
|
540
|
+
|
|
541
|
+
Clean checkouts can prepare the ignored Clang, clangd, and OCaml browser payloads from one
|
|
542
|
+
receipt-verified manifest:
|
|
543
|
+
|
|
544
|
+
```bash
|
|
545
|
+
pnpm run prepare:test-assets -- clangd
|
|
546
|
+
pnpm run prepare:test-assets -- clang ocaml
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
`scripts/browser-test-assets.v1.json` pins one existing Git snapshot of the published asset graph
|
|
550
|
+
and every downloaded file's exact size and SHA-256 digest. CI downloads that immutable snapshot
|
|
551
|
+
from GitHub without WAF credentials. Update the snapshot URL and all changed receipts together;
|
|
552
|
+
do not replace a receipt with bytes from a mutable deployment URL. Receipt failures report both
|
|
553
|
+
expected and actual byte counts and SHA-256 digests.
|
|
554
|
+
|
|
555
|
+
OCaml preparation keeps these verified download inputs in a separate receipt-keyed cache,
|
|
556
|
+
compiles the tracked TypeScript browser adapter with the producer's locked compiler, and syncs
|
|
557
|
+
that adapter together with the verified native bundle. The sync derives the final
|
|
558
|
+
`wasmOcamlVersion.ts` profile; downloaded input receipts remain unchanged. This makes adapter
|
|
559
|
+
fixes reproducible in clean CI without rebuilding or publishing the native OCaml toolchain.
|
|
560
|
+
Gzip-only Binaryen inputs are checked against their expanded manifest receipts before sync.
|
|
561
|
+
At runtime, raw gzip packs retain compressed and expanded receipt checks; HTTP-decoded packs
|
|
562
|
+
are bounded and verified against the exact expanded size and SHA-256.
|
|
563
|
+
|
|
564
|
+
The preparer rejects source or target paths outside their configured roots, checks each redirect
|
|
565
|
+
before following it, writes atomically, and reuses only matching files. With no group argument,
|
|
566
|
+
it prepares both the Clang delivery bundle and the complete OCaml browser compiler graph.
|
|
567
|
+
`WASM_IDLE_TEST_ASSET_BASE_URL` can select a compatible mirror with the same receipt-verified bytes.
|
|
568
|
+
For protected local browser tests, provide `WASM_IDLE_TEST_BYPASS_COOKIE` through the environment
|
|
569
|
+
in `dev_bypass_waf=<value>` form; the browser cookie jar scopes it to the test origin. Asset
|
|
570
|
+
downloads forward this optional cookie only to the trusted `https://seorii.page` origin and never
|
|
571
|
+
to GitHub or another mirror. There is no built-in credential fallback.
|
|
572
|
+
|
|
573
|
+
Browser-level Rust checks are reproducible from this repo:
|
|
65
574
|
|
|
66
575
|
```bash
|
|
67
576
|
cd wasm-idle
|
|
68
577
|
pnpm run probe:rust-browser
|
|
69
578
|
pnpm run test:browser:playwright
|
|
70
|
-
pnpm run probe:tinygo-browser
|
|
71
|
-
pnpm run test:browser:tinygo
|
|
72
579
|
|
|
73
580
|
WASM_IDLE_BROWSER_URL='http://localhost:5173/absproxy/5173/' \
|
|
74
581
|
WASM_IDLE_REUSE_LOCAL_PREVIEW=1 \
|
|
75
582
|
pnpm run probe:rust-browser
|
|
76
583
|
|
|
77
|
-
WASM_IDLE_BROWSER_URL='http://localhost:5173/absproxy/5173/' \
|
|
78
|
-
WASM_IDLE_REUSE_LOCAL_PREVIEW=1 \
|
|
79
|
-
pnpm run probe:tinygo-browser
|
|
80
|
-
|
|
81
584
|
WASM_IDLE_RUN_REAL_BROWSER_RUST=1 \
|
|
82
585
|
WASM_IDLE_BROWSER_URL='http://localhost:5173/absproxy/5173/' \
|
|
83
586
|
WASM_IDLE_REUSE_LOCAL_PREVIEW=1 \
|
|
84
587
|
pnpm exec vitest run src/lib/playground/rust.playwright.test.ts
|
|
85
|
-
|
|
86
|
-
WASM_IDLE_RUN_REAL_BROWSER_TINYGO=1 \
|
|
87
|
-
WASM_IDLE_BROWSER_URL='http://localhost:5173/absproxy/5173/' \
|
|
88
|
-
WASM_IDLE_REUSE_LOCAL_PREVIEW=1 \
|
|
89
|
-
pnpm exec vitest run src/lib/playground/tinygo.playwright.test.ts
|
|
90
588
|
```
|
|
91
589
|
|
|
92
|
-
|
|
590
|
+
The runtime probe exercises the real Chromium page path. The default Rust probe now feeds stdin with a
|
|
93
591
|
single line (`5\n`) and expects the page to finish without sending EOF, which keeps the regression
|
|
94
592
|
aligned with the default Rust sample and proves that pressing Enter is enough for line-based stdin.
|
|
95
593
|
Programs that intentionally read stdin until EOF can still be finished with `Ctrl+D` or the toolbar
|
|
@@ -97,14 +595,9 @@ Programs that intentionally read stdin until EOF can still be finished with `Ctr
|
|
|
97
595
|
The browser helper writes stdin through the page-owned `window.__wasmIdleDebug.writeTerminalInput(...)`
|
|
98
596
|
hook instead of trying to click xterm's hidden helper textarea, which proved too flaky for repeatable
|
|
99
597
|
Playwright runs.
|
|
100
|
-
The TinyGo probe follows the same pattern. The host-assisted path still looks for
|
|
101
|
-
`tinygo host compile ready: target=wasip1` when you opt into `?tinygoCompilePath=host`, while the
|
|
102
|
-
default browser path should load the vendored
|
|
103
|
-
runtime in `direct` mode and avoid the old bootstrap compile command altogether.
|
|
104
|
-
The TinyGo browser commands currently default to `vite dev`.
|
|
105
598
|
If Rust ever reports `invalid metadata files for crate core` or `Unsupported archive identifier`,
|
|
106
599
|
the browser almost always fetched a stale or wrong `wasm-rust` sysroot asset. Hard refresh the page
|
|
107
|
-
and resync `static/wasm-rust/` from
|
|
600
|
+
and rebuild then resync `static/wasm-rust/` from `runtimes/wasm-rust/dist/`.
|
|
108
601
|
When browser-rustc does retry, it now emits a visible warning instead of only a debug-level
|
|
109
602
|
transition into attempt `2/5`, `3/5`, and so on.
|
|
110
603
|
When the Rust `log` option is enabled, those compile-time `wasm-rust` progress and retry lines are
|
|
@@ -119,14 +612,157 @@ session; the repo-owned regression target is the local preview path above.
|
|
|
119
612
|
|
|
120
613
|
## Runtime expectations
|
|
121
614
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
`
|
|
615
|
+
The BQN, Forth, and Tcl static Workers use a shared stdin ring. Its write counter and EOF/cancel
|
|
616
|
+
flags are separate atomic values: notifying a waiter does not change its expected write counter.
|
|
617
|
+
Their Worker-only waits therefore recheck these flags at least every 100 ms while scheduled, even
|
|
618
|
+
when an EOF/cancel notification arrives just before the wait starts. This is not an input deadline;
|
|
619
|
+
an open, empty stdin remains available for later input. `staticStdinRingWorker.test.ts` forces that
|
|
620
|
+
check-to-wait ordering for both EOF and cancellation without relying on scheduling luck.
|
|
621
|
+
|
|
622
|
+
`@wasm-idle/terminal` is an optional browser UI package:
|
|
623
|
+
|
|
624
|
+
```bash
|
|
625
|
+
pnpm add @wasm-idle/terminal
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
The root `wasm-idle` package exports the language runtime and playground binding APIs without
|
|
629
|
+
installing Svelte or xterm. Browser applications install `@wasm-idle/terminal` separately and pass
|
|
630
|
+
it a `PlaygroundBinding`; Node hosts do not need the package.
|
|
631
|
+
|
|
632
|
+
`@wasm-idle/debug` is an optional debugger UI/controller plugin that must be installed separately:
|
|
633
|
+
|
|
634
|
+
```bash
|
|
635
|
+
pnpm add @wasm-idle/debug
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
The root `wasm-idle` package no longer exports the debug session controller, language adapters, or
|
|
639
|
+
Monaco integration. Applications that need those APIs import them from `@wasm-idle/debug`; the
|
|
640
|
+
Pages application keeps the package as a dev dependency. `svelte` is a required peer for the
|
|
641
|
+
reactive controller, while `monaco-editor` is needed only when using the editor integration.
|
|
642
|
+
|
|
643
|
+
`@wasm-idle/lsp` is an optional editor plugin that must be installed separately:
|
|
644
|
+
|
|
645
|
+
```bash
|
|
646
|
+
pnpm add @wasm-idle/lsp
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
Installing the root `wasm-idle` package does not install `@wasm-idle/lsp` transitively. Consumers
|
|
650
|
+
that want browser editor LSP support must add it explicitly, along with the optional provider peers
|
|
651
|
+
they use.
|
|
652
|
+
|
|
653
|
+
The `wasm-idle`, `@wasm-idle/debug`, `@wasm-idle/terminal`, `@wasm-idle/llvm-core`, and
|
|
654
|
+
`@wasm-idle/lsp` npm packages contain host/provider JS, types, and lightweight UI/editor-service
|
|
655
|
+
code, but no compiler or language-runtime payloads. The `wasm-llvm` repository produces compiler
|
|
656
|
+
assets but is not an npm runtime dependency. Static compiler/runtime assets are deployed separately
|
|
657
|
+
and loaded through `runtimeAssets` HTTP(S) URLs. References to bundled assets below mean files
|
|
658
|
+
deployed to the page's HTTP origin, not files embedded in an npm package; library consumers must
|
|
659
|
+
provide their own externally hosted URLs.
|
|
660
|
+
|
|
661
|
+
Browser runtime payloads stored as `.wasm.gz` or `.tar.gz` use the platform
|
|
662
|
+
`DecompressionStream('gzip')` path. Zig's standard library is delivered as `std.tar.gz`, and the
|
|
663
|
+
Clang and COBOL producer archives are repackaged as `.wasm.gz`/`.tar.gz` during sync. `fflate`
|
|
664
|
+
remains for user-created workspace ZIP files and legacy external runtime URLs; it is dynamically
|
|
665
|
+
loaded for compatibility instead of participating in the default runtime path.
|
|
666
|
+
|
|
667
|
+
`@wasm-idle/lsp` keeps its host and provider JS in the package. Heavy compiler/runtime modules are
|
|
668
|
+
external static assets loaded only after LSP is enabled: Python uses `pyodide/pyodide.mjs`, R uses
|
|
669
|
+
the versioned `webr/<hash>/webr.js`, and the AssemblyScript and DuckDB/SQLite SQL providers reuse
|
|
670
|
+
their `static/wasm-*/runtime.mjs` trees. Ruby instead requires a complete identity-and-receipt
|
|
671
|
+
profile; the page host verifies its manifest, module, and compressed Wasm before creating the LSP
|
|
672
|
+
worker. Other compiler-backed providers follow the same external URL model through their
|
|
673
|
+
language-server asset configuration.
|
|
674
|
+
|
|
675
|
+
Pure-JavaScript provider engines for TypeScript, GraphQL, WAT, and document languages are optional
|
|
676
|
+
peers of `@wasm-idle/lsp`, not mandatory production dependencies. The Pages application keeps
|
|
677
|
+
`@wasm-idle/lsp` as a dev dependency and dynamically imports each provider only after LSP is enabled
|
|
678
|
+
and its language is selected. Vite emits those providers into lazy worker chunks, so they are not
|
|
679
|
+
fetched before they are needed. Library consumers using one of those providers must install its
|
|
680
|
+
optional peer set, while compiler and language-runtime payloads still come only from external URLs.
|
|
681
|
+
|
|
682
|
+
Rust supports an external mirror of the pinned compiler graph for library consumers. Set
|
|
683
|
+
`PUBLIC_WASM_RUST_COMPILER_URL` or `runtimeAssets.rust.compilerUrl` to the logical `index.js` URL
|
|
684
|
+
with the exact generated runtime-manifest query, and mirror every `.bin` delivery path and receipt
|
|
685
|
+
from `WASM_RUST_EXECUTABLE_GRAPH_PROFILE`. An arbitrary browser-loadable ESM entry or a raw
|
|
686
|
+
`dist/index.js` is rejected. Rust source instrumentation remains a separate static asset.
|
|
687
|
+
TinyGo uses the public receipt-verified `static/wasm-tinygo/upstream.js` compiler by default.
|
|
688
|
+
Override it with `PUBLIC_WASM_TINYGO_MODULE_URL` or `runtimeAssets.tinygo.moduleUrl`; a custom
|
|
689
|
+
`runtimeAssets.tinygo.assetLoader` can serve the module's verified sibling toolchain files. The
|
|
690
|
+
public route supports only `wasip1` and rejects unsupported targets instead of selecting the legacy
|
|
691
|
+
subset.
|
|
692
|
+
WAT uses the bundled `static/wasm-wat/` WABT browser module by default. Override it with
|
|
693
|
+
`PUBLIC_WASM_WAT_MODULE_URL`, or pass `runtimeAssets.wat.moduleUrl`.
|
|
694
|
+
WASM executes binary WebAssembly modules directly through the browser WebAssembly API. The editor
|
|
695
|
+
accepts base64, hex, or `data:application/wasm` content, and the worker connects WASI preview1
|
|
696
|
+
stdin/stdout/stderr plus the `env.readByte` import used by the WAT runner.
|
|
697
|
+
DuckDB dynamically imports `static/wasm-duckdb/runtime.mjs`, produced from
|
|
698
|
+
`@duckdb/duckdb-wasm`, and opens a fresh in-memory database per run. Override the module with
|
|
699
|
+
`PUBLIC_WASM_DUCKDB_MODULE_URL` or `runtimeAssets.duckdb.moduleUrl`. Workspace files are registered
|
|
700
|
+
before the active query; terminal input is registered as `stdin.txt` and `/dev/stdin` for queries
|
|
701
|
+
that load it as a file.
|
|
702
|
+
SQLite dynamically imports `static/wasm-sqlite/runtime.mjs`, produced from `sql.js`, and resolves
|
|
703
|
+
its default `sql-wasm.wasm` from that static tree. Override the module and optional WASM payload
|
|
704
|
+
with `runtimeAssets.sqlite.moduleUrl`/`wasmUrl` or the corresponding
|
|
705
|
+
`PUBLIC_WASM_SQLITE_MODULE_URL`/`PUBLIC_WASM_SQLITE_WASM_URL` values.
|
|
706
|
+
PHP dynamically imports the checked-in `static/wasm-php/runtime.mjs` output from the standalone
|
|
707
|
+
`producers/wasm-php` build. That producer pins `@php-wasm/web-8-4@3.1.34` and
|
|
708
|
+
`@php-wasm/universal@3.1.34`. It always creates PHP 8.4; there is no version field or
|
|
709
|
+
environment-based version selector. Override only the module location with
|
|
710
|
+
`PUBLIC_WASM_PHP_MODULE_URL` or `runtimeAssets.php.moduleUrl`. A custom host must serve the entry's
|
|
711
|
+
sibling chunks and assets with compatible CORS and cross-origin isolation headers; a cross-origin
|
|
712
|
+
host cannot use wasm-idle's same-origin gzip service worker.
|
|
713
|
+
Bash verifies one unified manifest plus the stored Wasmer SDK JavaScript, Wasmer Wasm, and WEBc
|
|
714
|
+
before it starts the outer worker. The worker imports only the verified SDK bytes and uses a fixed
|
|
715
|
+
application-owned nested bootstrap; SDK, worker, Wasm, WEBc, sentinel, and registry network
|
|
716
|
+
fallbacks are not part of the normal execution path. A `rootUrl` mirror reuses the bundled profile.
|
|
717
|
+
Explicit `runtimeAssets.bash.baseUrl`, `manifestUrl`, `moduleUrl`, `wasmerWasmUrl`, or `webcUrl`
|
|
718
|
+
overrides require a complete matching profile and receipts. Arbitrary `workerUrl` overrides are
|
|
719
|
+
rejected because executable nested-worker substitution is outside the trust contract.
|
|
720
|
+
Lua uses the bundled `static/wasm-lua/` wasmoon browser module plus its local `glue.wasm`
|
|
721
|
+
payload by default. Override it with `PUBLIC_WASM_LUA_MODULE_URL`, or pass
|
|
722
|
+
`runtimeAssets.lua.moduleUrl`.
|
|
723
|
+
Zig uses the bundled `static/wasm-zig/zig_small.wasm` compiler and `static/wasm-zig/std.tar.gz`
|
|
724
|
+
standard library by default. Override them with `PUBLIC_WASM_ZIG_COMPILER_URL` and
|
|
725
|
+
`PUBLIC_WASM_ZIG_STDLIB_URL`, or pass `runtimeAssets.zig.compilerUrl` and
|
|
726
|
+
`runtimeAssets.zig.stdlibUrl`. The compiler runs under browser WASI, emits a `wasm64-wasi`
|
|
727
|
+
artifact with the self-hosted backend, and wasm-idle executes that artifact locally in the worker.
|
|
728
|
+
Scheme uses the bundled `static/wasm-lisp/` Puppy Scheme compiler profile by default. The execution
|
|
729
|
+
and LSP workers verify its pinned manifest, stored bytes, decompressed size, and logical asset hashes
|
|
730
|
+
before importing code. A custom profile must provide `runtimeAssets.lisp.moduleUrl`, `manifestUrl`,
|
|
731
|
+
and `manifestFingerprint`, or the corresponding `PUBLIC_WASM_LISP_*` variables.
|
|
732
|
+
Tcl uses the bundled `static/wasm-tcl/` Wacl profile by default. The host verifies the manifest and
|
|
733
|
+
all transport receipts, manually decompresses the canonical `.gz.bin` assets with exact output
|
|
734
|
+
limits, and transfers only verified logical bytes to a runner that pins the same manifest
|
|
735
|
+
fingerprint and closes after one run. URL-only overrides may mirror the bundled bytes. Authorizing
|
|
736
|
+
different executable bytes requires all Tcl identity fields, manifest and asset receipts, plus the
|
|
737
|
+
matching `workerReceipt` in the same `runtimeAssets.tcl` object; omitted trust fields never fall back
|
|
738
|
+
to bundled values. The pinned Wacl/RequireJS payload remains trusted executable code: its verified
|
|
739
|
+
bootstrap needs no follow-up asset fetch, but the worker is not a general network sandbox. Hosts
|
|
740
|
+
must serve `.gz.bin` as opaque bytes without `Content-Encoding: gzip`; legacy `.gz` aliases are not
|
|
741
|
+
referenced by the current manifest.
|
|
742
|
+
Ruby uses the receipt-pinned `static/wasm-ruby/` CRuby 3.4 profile. Before creating a worker, the
|
|
743
|
+
page host verifies `runtime-manifest.v2.json`, canonical `runtime.mjs.bin` storage, compressed
|
|
744
|
+
`ruby_stdlib-*.wasm.gz.bin` storage, the decompressed WASM receipt, and the complete provenance
|
|
745
|
+
fingerprint. It then transfers exactly those three verified logical buffers to a persistent worker
|
|
746
|
+
that performs no runtime-asset fetches. A `rootUrl` mirror reuses the bundled profile. Any explicit
|
|
747
|
+
`runtimeAssets.ruby` override must provide one complete identity-and-receipt profile and use its
|
|
748
|
+
same-origin canonical paths with absent or exact receipt query pins. URL-only
|
|
749
|
+
`PUBLIC_WASM_RUBY_*` overrides intentionally fail closed. The producer receipt covers every
|
|
750
|
+
package-owned Vite file but excludes pnpm-generated nested `node_modules/.bin/` launch shims, whose
|
|
751
|
+
installation paths are not reproducible package content.
|
|
752
|
+
AssemblyScript dynamically imports `static/wasm-assemblyscript/runtime.mjs`, produced from the
|
|
753
|
+
pinned AssemblyScript compiler and loader. Override it with
|
|
754
|
+
`PUBLIC_WASM_ASSEMBLYSCRIPT_MODULE_URL` or `runtimeAssets.assemblyscript.moduleUrl`. Compilation
|
|
755
|
+
uses `--runtime incremental --bindings raw --optimize --exportRuntime` and instantiates the emitted
|
|
756
|
+
WebAssembly locally. `_start` or `main` runs first; otherwise zero-argument numeric, boolean, and
|
|
757
|
+
string exports are printed to the terminal. AssemblyScript programs can import stdin helpers from
|
|
758
|
+
`env`: `readLine(): string | null`, `readAll(): string`, and `readByte(): i32`. `readLine` waits for
|
|
759
|
+
Enter-submitted terminal input, while `readAll` reads until Ctrl+D or the EOF button.
|
|
760
|
+
WAT modules can import `env.readByte(): i32` for byte-oriented stdin; it returns `-1` at EOF.
|
|
761
|
+
Haskell uses the bundled `static/wasm-haskell/` `ghc-in-browser` assets by default. Override them
|
|
762
|
+
with `PUBLIC_WASM_HASKELL_MODULE_URL`, `PUBLIC_WASM_HASKELL_ROOTFS_URL`, and
|
|
763
|
+
`PUBLIC_WASM_HASKELL_BSDTAR_URL`, or pass `runtimeAssets.haskell`. The worker extracts the wasm GHC
|
|
764
|
+
root filesystem, loads `dyld.mjs`, and invokes the browser GHC/GHCi entry point locally. Browser
|
|
765
|
+
stdin is wired into the dyld WASI fd0, so `getLine` reads terminal input.
|
|
130
766
|
|
|
131
767
|
The Rust browser path now executes returned artifacts through the target-appropriate runtime inside
|
|
132
768
|
the Rust worker:
|
|
@@ -134,7 +770,7 @@ the Rust worker:
|
|
|
134
770
|
- `wasm32-wasip1` runs as preview1 core wasm through `@bjorn3/browser_wasi_shim`
|
|
135
771
|
- `wasm32-wasip2` runs as a preview2 component through `preview2-shim` plus transpiled `jco` output
|
|
136
772
|
|
|
137
|
-
|
|
773
|
+
C-family compilation remains hosted by `@wasm-idle/llvm-core`, while Rust delegates artifact
|
|
138
774
|
execution to `wasm-rust` so the selected target and returned artifact format stay aligned.
|
|
139
775
|
|
|
140
776
|
`Terminal` and `playground(...).load(...)` support either the legacy shared `path`/`rootUrl` or per-runtime asset config:
|
|
@@ -144,9 +780,24 @@ import type { PlaygroundRuntimeAssets } from 'wasm-idle';
|
|
|
144
780
|
|
|
145
781
|
const runtimeAssets: PlaygroundRuntimeAssets = {
|
|
146
782
|
rootUrl: 'https://cdn.example.com/repl',
|
|
783
|
+
assemblyscript: {
|
|
784
|
+
moduleUrl: 'https://cdn.example.com/repl/wasm-assemblyscript/runtime.mjs'
|
|
785
|
+
},
|
|
786
|
+
duckdb: {
|
|
787
|
+
moduleUrl: 'https://cdn.example.com/repl/wasm-duckdb/runtime.mjs'
|
|
788
|
+
},
|
|
789
|
+
php: {
|
|
790
|
+
moduleUrl: 'https://cdn.example.com/repl/wasm-php/runtime.mjs'
|
|
791
|
+
},
|
|
792
|
+
sqlite: {
|
|
793
|
+
moduleUrl: 'https://cdn.example.com/repl/wasm-sqlite/runtime.mjs'
|
|
794
|
+
},
|
|
147
795
|
python: {
|
|
148
796
|
loader: async ({ asset }) => ({ url: `https://cdn.example.com/repl/pyodide/${asset}` })
|
|
149
797
|
},
|
|
798
|
+
r: {
|
|
799
|
+
baseUrl: 'https://cdn.example.com/repl/webr/<asset-version>/'
|
|
800
|
+
},
|
|
150
801
|
java: {
|
|
151
802
|
baseUrl: 'https://cdn.example.com/repl/teavm/'
|
|
152
803
|
},
|
|
@@ -157,38 +808,64 @@ const runtimeAssets: PlaygroundRuntimeAssets = {
|
|
|
157
808
|
loader: async ({ asset }) => ({ url: `https://cdn.example.com/repl/clangd/${asset}` })
|
|
158
809
|
},
|
|
159
810
|
rust: {
|
|
160
|
-
compilerUrl:
|
|
811
|
+
compilerUrl:
|
|
812
|
+
'https://cdn.example.com/wasm-rust/index.js?v=<runtime-manifest-sha256>&rustManifestBytes=<runtime-manifest-bytes>&rustManifestSha256=<runtime-manifest-sha256>'
|
|
813
|
+
},
|
|
814
|
+
dotnet: {
|
|
815
|
+
moduleUrl: 'https://cdn.example.com/wasm-dotnet/index.js'
|
|
816
|
+
},
|
|
817
|
+
wat: {
|
|
818
|
+
moduleUrl: 'https://cdn.example.com/wasm-wat/index.js'
|
|
819
|
+
},
|
|
820
|
+
lua: {
|
|
821
|
+
moduleUrl: 'https://cdn.example.com/wasm-lua/index.js'
|
|
161
822
|
},
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
823
|
+
zig: {
|
|
824
|
+
compilerUrl: 'https://cdn.example.com/wasm-zig/zig_small.wasm',
|
|
825
|
+
stdlibUrl: 'https://cdn.example.com/wasm-zig/std.tar.gz'
|
|
826
|
+
},
|
|
827
|
+
lisp: {
|
|
828
|
+
moduleUrl: 'https://cdn.example.com/wasm-lisp/index.js'
|
|
829
|
+
},
|
|
830
|
+
haskell: {
|
|
831
|
+
moduleUrl: 'https://cdn.example.com/wasm-haskell/dyld.mjs',
|
|
832
|
+
rootfsUrl: 'https://cdn.example.com/wasm-haskell/rootfs.tar.zst',
|
|
833
|
+
bsdtarUrl: 'https://cdn.example.com/wasm-haskell/bsdtar.wasm'
|
|
834
|
+
},
|
|
835
|
+
nim: {
|
|
836
|
+
baseUrl: 'https://cdn.example.com/wasm-nim/',
|
|
837
|
+
workerUrl: 'https://cdn.example.com/wasm-nim/runner-worker.js'
|
|
165
838
|
}
|
|
166
839
|
};
|
|
167
840
|
```
|
|
168
841
|
|
|
169
|
-
|
|
842
|
+
Static module overrides such as PHP's `moduleUrl` identify an entry module, not a self-contained
|
|
843
|
+
file. Mirror its complete sibling asset tree at the same relative paths. Cross-origin asset hosts
|
|
844
|
+
must provide compatible CORS and COEP/CORP headers and cannot rely on wasm-idle's same-origin gzip
|
|
845
|
+
service worker.
|
|
170
846
|
|
|
171
|
-
|
|
847
|
+
Verified static runtimes such as Janet and Julia intentionally omit URL-only examples: a custom
|
|
848
|
+
`baseUrl`, `manifestUrl`, or `workerUrl` must be accompanied by every identity and asset-receipt
|
|
849
|
+
field declared by that runtime's asset config, including the matching `workerReceipt`. Partial
|
|
850
|
+
trust bundles fail closed instead of borrowing receipts from bundled executable bytes.
|
|
851
|
+
|
|
852
|
+
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 logical, profile-pinned graph entry URL whose sibling inert storage exactly matches the generated receipts; it does not import that HTTP entry directly. C#, F#, and VB.NET expect a browser-loadable `wasm-dotnet` module with its language-specific static .NET `browser-wasm` runtime assets. Compressed TeaVM runtime assets are no longer unpacked inside the library; provide the final file URL or handle decompression in your own loader.
|
|
853
|
+
|
|
854
|
+
To reuse the same runtime asset configuration for both `<Terminal>` and direct `playground(...)`
|
|
855
|
+
access, bind it once:
|
|
172
856
|
|
|
173
857
|
```ts
|
|
174
|
-
import Terminal
|
|
858
|
+
import Terminal from '@wasm-idle/terminal';
|
|
859
|
+
import { createPlaygroundBinding } from 'wasm-idle';
|
|
175
860
|
|
|
176
861
|
const wasmIdle = createPlaygroundBinding({
|
|
177
862
|
rootUrl: 'https://cdn.example.com/repl',
|
|
178
863
|
rust: {
|
|
179
|
-
compilerUrl:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
moduleUrl: 'https://cdn.example.com/wasm-
|
|
184
|
-
assetPacks: [
|
|
185
|
-
{
|
|
186
|
-
index: 'https://cdn.example.com/wasm-tinygo/runtime-pack/runtime-pack.index.json',
|
|
187
|
-
asset: 'https://cdn.example.com/wasm-tinygo/runtime-pack/runtime-pack.bin',
|
|
188
|
-
fileCount: 12,
|
|
189
|
-
totalBytes: 123456
|
|
190
|
-
}
|
|
191
|
-
]
|
|
864
|
+
compilerUrl:
|
|
865
|
+
'https://cdn.example.com/wasm-rust/index.js?v=<runtime-manifest-sha256>&rustManifestBytes=<runtime-manifest-bytes>&rustManifestSha256=<runtime-manifest-sha256>'
|
|
866
|
+
},
|
|
867
|
+
dotnet: {
|
|
868
|
+
moduleUrl: 'https://cdn.example.com/wasm-dotnet/index.js'
|
|
192
869
|
}
|
|
193
870
|
});
|
|
194
871
|
|
|
@@ -200,5 +877,7 @@ await sandbox.load('print("hi")', false);
|
|
|
200
877
|
<Terminal {...wasmIdle.terminalProps} bind:terminal />
|
|
201
878
|
```
|
|
202
879
|
|
|
203
|
-
|
|
204
|
-
`wasm-
|
|
880
|
+
Compiler assets produced by [`wasm-llvm`](https://github.com/seo-rii/wasm-llvm) are deployed to
|
|
881
|
+
external static hosting and loaded by `@wasm-idle/llvm-core`. Also powered by Pyodide, TeaVM, `wasm-rust`,
|
|
882
|
+
`wasm-dotnet`, `wasm-of-js-of-ocaml`, `wasm-typescript`, `wasm-lisp`,
|
|
883
|
+
`wasm-wat`, `wasm-lua`, `wasm-zig`, CBQN, Janet, AtomVM/Popcorn, and `ghc-in-browser`.
|