wasm-idle 1.0.12 → 1.1.2
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 +150 -37
- package/dist/playground/applicationAssets.js +2 -0
- package/dist/playground/assetBridge.js +106 -31
- package/dist/playground/assets.d.ts +2 -2
- package/dist/playground/c3.js +22 -0
- package/dist/playground/c3Memory.d.ts +19 -0
- package/dist/playground/c3Memory.js +117 -0
- package/dist/playground/cachedClang.js +143 -34
- package/dist/playground/clangAssetIntegrity.js +6 -6
- package/dist/playground/clangWorkerProtocol.d.ts +12 -1
- package/dist/playground/cobol.d.ts +3 -0
- package/dist/playground/cobol.js +10 -1
- package/dist/playground/commonlisp.d.ts +8 -0
- package/dist/playground/commonlisp.js +33 -0
- package/dist/playground/commonlispAssets.d.ts +30 -0
- package/dist/playground/commonlispAssets.js +184 -0
- package/dist/playground/compiledArtifactCache.d.ts +3 -1
- package/dist/playground/compiledArtifactCache.js +31 -5
- package/dist/playground/container/ContainerExplorer.svelte +307 -0
- package/dist/playground/container/ContainerExplorer.svelte.d.ts +14 -0
- package/dist/playground/container/binding.d.ts +26 -0
- package/dist/playground/container/binding.js +247 -0
- package/dist/playground/container/clang-runtime.d.ts +38 -0
- package/dist/playground/container/clang-runtime.js +343 -0
- package/dist/playground/container/client.d.ts +15 -0
- package/dist/playground/container/client.js +189 -0
- package/dist/playground/container/explorer.d.ts +31 -0
- package/dist/playground/container/explorer.js +112 -0
- package/dist/playground/container/owner.worker.d.ts +1 -0
- package/dist/playground/container/owner.worker.js +390 -0
- package/dist/playground/container/protocol.d.ts +73 -0
- package/dist/playground/container/protocol.js +28 -0
- package/dist/playground/container/release.d.ts +31 -0
- package/dist/playground/container/release.js +612 -0
- package/dist/playground/container/runtime-adapter.d.ts +73 -0
- package/dist/playground/container/runtime-adapter.js +474 -0
- package/dist/playground/container/shell-control.d.ts +49 -0
- package/dist/playground/container/shell-control.js +303 -0
- package/dist/playground/container/workspace.d.ts +8 -0
- package/dist/playground/container/workspace.js +29 -0
- package/dist/playground/d.d.ts +6 -1
- package/dist/playground/d.js +83 -5
- package/dist/playground/dotnet.js +6 -8
- package/dist/playground/fortran.d.ts +3 -0
- package/dist/playground/fortran.js +10 -1
- package/dist/playground/go.js +14 -3
- package/dist/playground/goDebugInstrumentation.js +184 -54
- package/dist/playground/index.d.ts +1 -1
- package/dist/playground/index.js +14 -0
- package/dist/playground/java.js +3 -2
- package/dist/playground/javaRuntimeErrors.d.ts +9 -0
- package/dist/playground/javaRuntimeErrors.js +60 -0
- package/dist/playground/javaRuntimeStdin.d.ts +9 -0
- package/dist/playground/javaRuntimeStdin.js +145 -0
- package/dist/playground/lean4.d.ts +13 -0
- package/dist/playground/lean4.js +50 -0
- package/dist/playground/lean4Assets.d.ts +25 -0
- package/dist/playground/lean4Assets.js +123 -0
- package/dist/playground/lfortran.js +10 -0
- package/dist/playground/lfortranAssets.d.ts +2 -2
- package/dist/playground/loadingProgress.js +4 -1
- package/dist/playground/nim.js +22 -0
- package/dist/playground/objectivec.d.ts +3 -0
- package/dist/playground/objectivec.js +11 -2
- package/dist/playground/options.d.ts +2 -0
- package/dist/playground/python.js +8 -0
- package/dist/playground/runtimeAssetCache.d.ts +1 -32
- package/dist/playground/runtimeAssetCache.js +1 -193
- package/dist/playground/runtimeSession.d.ts +2 -2
- package/dist/playground/runtimeSession.js +11 -11
- package/dist/playground/rust.d.ts +6 -0
- package/dist/playground/rust.js +103 -6
- package/dist/playground/staticStdinRing.d.ts +2 -1
- package/dist/playground/staticStdinRing.js +21 -10
- package/dist/playground/staticWorkerRuntime.d.ts +15 -1
- package/dist/playground/staticWorkerRuntime.js +119 -17
- package/dist/playground/tinygo.d.ts +3 -0
- package/dist/playground/tinygo.js +81 -6
- package/dist/playground/v.d.ts +3 -0
- package/dist/playground/v.js +10 -1
- package/dist/playground/wasmAwkVersion.d.ts +13 -13
- package/dist/playground/wasmAwkVersion.js +4 -4
- package/dist/playground/wasmBqnVersion.d.ts +2 -2
- package/dist/playground/wasmBqnVersion.js +2 -2
- package/dist/playground/wasmC3Version.d.ts +2 -2
- package/dist/playground/wasmC3Version.js +2 -2
- package/dist/playground/wasmClojureScriptVersion.d.ts +2 -2
- package/dist/playground/wasmClojureScriptVersion.js +2 -2
- package/dist/playground/wasmCommonLispVersion.d.ts +32 -0
- package/dist/playground/wasmCommonLispVersion.js +33 -0
- package/dist/playground/wasmDIntegrity.d.ts +5 -5
- package/dist/playground/wasmDIntegrity.js +5 -5
- package/dist/playground/wasmDVersion.d.ts +16 -1
- package/dist/playground/wasmDVersion.js +16 -1
- package/dist/playground/wasmDebugVersion.d.ts +1 -1
- package/dist/playground/wasmDebugVersion.js +1 -1
- package/dist/playground/wasmForthVersion.d.ts +2 -2
- package/dist/playground/wasmForthVersion.js +2 -2
- package/dist/playground/wasmGleamVersion.d.ts +2 -2
- package/dist/playground/wasmGleamVersion.js +2 -2
- package/dist/playground/wasmGrainVersion.d.ts +2 -2
- package/dist/playground/wasmGrainVersion.js +2 -2
- package/dist/playground/wasmJVersion.d.ts +2 -2
- package/dist/playground/wasmJVersion.js +2 -2
- package/dist/playground/wasmJanetVersion.js +2 -2
- package/dist/playground/wasmJuliaVersion.js +2 -2
- package/dist/playground/wasmLean4Version.d.ts +110 -0
- package/dist/playground/wasmLean4Version.js +111 -0
- package/dist/playground/wasmLfortranVersion.d.ts +2 -2
- package/dist/playground/wasmLfortranVersion.js +2 -2
- package/dist/playground/wasmNimVersion.d.ts +9 -9
- package/dist/playground/wasmNimVersion.js +6 -6
- package/dist/playground/wasmOcamlVersion.d.ts +2 -2
- package/dist/playground/wasmOcamlVersion.js +1 -1
- package/dist/playground/wasmPascalVersion.js +2 -2
- package/dist/playground/wasmPerlVersion.js +2 -2
- package/dist/playground/wasmPrologVersion.d.ts +2 -2
- package/dist/playground/wasmPrologVersion.js +2 -2
- package/dist/playground/wasmReScriptVersion.d.ts +2 -2
- package/dist/playground/wasmReScriptVersion.js +2 -2
- package/dist/playground/wasmRustVersion.d.ts +8 -8
- package/dist/playground/wasmRustVersion.js +7 -7
- package/dist/playground/wasmTclVersion.d.ts +4 -4
- package/dist/playground/wasmTclVersion.js +2 -2
- package/dist/playground/wasmTinyGoVersion.d.ts +14 -14
- package/dist/playground/wasmTinyGoVersion.js +14 -14
- package/dist/playground/wasmTypeScriptVersion.d.ts +5 -5
- package/dist/playground/wasmTypeScriptVersion.js +5 -5
- package/dist/playground/worker/cachedClangCompile.js +52 -4
- package/dist/playground/worker/cachedClangExecute.js +6 -5
- package/dist/playground/worker/clang.js +32 -10
- package/dist/playground/worker/cobol.js +2 -2
- package/dist/playground/worker/d.js +12 -5
- package/dist/playground/worker/fortran.js +2 -2
- package/dist/playground/worker/go.js +16 -5
- package/dist/playground/worker/haskell.js +10 -7
- package/dist/playground/worker/java.js +92 -39
- package/dist/playground/worker/lua.js +2 -3
- package/dist/playground/worker/php.js +15 -9
- package/dist/playground/worker/python.js +131 -131
- package/dist/playground/worker/pythonDebugPreview.d.ts +2 -0
- package/dist/playground/worker/pythonDebugPreview.js +55 -0
- package/dist/playground/worker/pythonExecution.d.ts +8 -0
- package/dist/playground/worker/pythonExecution.js +183 -0
- package/dist/playground/worker/pythonStdio.d.ts +32 -0
- package/dist/playground/worker/pythonStdio.js +253 -0
- package/dist/playground/worker/pythonWorkspaceFiles.d.ts +6 -0
- package/dist/playground/worker/pythonWorkspaceFiles.js +26 -0
- package/dist/playground/worker/pythonWorkspaceImports.d.ts +4 -0
- package/dist/playground/worker/pythonWorkspaceImports.js +129 -0
- package/dist/playground/worker/r.js +13 -6
- package/dist/playground/worker/rust.js +34 -2
- package/dist/playground/worker/sqlite.js +4 -3
- package/dist/playground/worker/tinygo.js +11 -3
- package/dist/playground/worker/typescript.js +2 -3
- package/dist/playground/worker/v.js +2 -2
- package/dist/playground/worker/wat.js +2 -3
- package/dist/playground/worker/zig.js +20 -6
- package/dist/playground/workerSession.d.ts +1 -28
- package/dist/playground/workerSession.js +1 -164
- package/package.json +30 -15
package/README.md
CHANGED
|
@@ -10,6 +10,9 @@ PostgreSQL, and PHP code.
|
|
|
10
10
|
Experimental LFortran execution is available separately from f2c Fortran; see
|
|
11
11
|
[the LFortran consumer contract and local setup](docs/lfortran.md).
|
|
12
12
|
|
|
13
|
+
Lean 4 runs the upstream `lean --run` interpreter in the browser; see
|
|
14
|
+
[Lean 4 browser execution](docs/lean4.md).
|
|
15
|
+
|
|
13
16
|
V runs the real V 0.5.2 compiler in the browser and compiles its C output with the shared
|
|
14
17
|
llvm-core Clang host; see [the V browser integration](docs/v-browser.md).
|
|
15
18
|
|
|
@@ -22,6 +25,33 @@ Verified downloads can be retained across reloads using a version-pinned, capaci
|
|
|
22
25
|
CacheStorage/IndexedDB cache. See [persistent asset cache configuration and coverage](docs/runtime-asset-cache.md)
|
|
23
26
|
for global/per-call opt-out, cleanup and prefetch APIs.
|
|
24
27
|
|
|
28
|
+
## Getting started
|
|
29
|
+
|
|
30
|
+
You need Node.js `^22.22.2`, `^24.15.0`, or `>=26.0.0`, and pnpm 12.9.1. These come from the root
|
|
31
|
+
`package.json` `engines` and `packageManager` fields, and `.npmrc` sets `engine-strict=true`.
|
|
32
|
+
`.tool-versions` pins Node.js 24.20.0 for asdf/mise.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pnpm install
|
|
36
|
+
pnpm dev
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`pnpm dev` builds the public workspace packages, then starts Vite with the cross-origin isolation
|
|
40
|
+
headers that `SharedArrayBuffer` requires. The app is served under the `/wasm-idle` base path, for
|
|
41
|
+
example `http://localhost:5173/wasm-idle/`.
|
|
42
|
+
|
|
43
|
+
Most runtime assets are checked in under `static/`. Some compiler payloads are gitignored and must
|
|
44
|
+
be prepared locally before those languages can run:
|
|
45
|
+
|
|
46
|
+
- `pnpm run prepare:test-assets` downloads the pinned Clang (with its matching clangd), OCaml,
|
|
47
|
+
C3, LFortran, Lean 4, and Common Lisp payloads. Pass group names, for example
|
|
48
|
+
`-- clang ocaml`, to prepare only some of them.
|
|
49
|
+
- `pnpm run prepare:wasm-debug-release` adds the LLDB debug runtime. Without it, C, C++, and
|
|
50
|
+
`wasm32-wasip1` Rust debug sessions use the trace fallback.
|
|
51
|
+
|
|
52
|
+
Other runtimes are refreshed from their producers with the `sync:*` scripts described under
|
|
53
|
+
[Monorepo layout](#monorepo-layout).
|
|
54
|
+
|
|
25
55
|
## Language support policy
|
|
26
56
|
|
|
27
57
|
wasm-idle language support must run user code through the real language implementation in the
|
|
@@ -91,9 +121,11 @@ debug runtime; the remaining debug-enabled languages retain wasm-idle's trace co
|
|
|
91
121
|
| Fennel | fennel.lua on Wasmoon | Yes | syntax | - |
|
|
92
122
|
| Zig | zig_small.wasm | Yes | syntax | - |
|
|
93
123
|
| Scheme | Puppy Scheme / wasm-lisp | Yes | syntax | - |
|
|
124
|
+
| Common Lisp | ECL 26.5.5 (Embeddable Common-Lisp) WASM | Yes | syntax | - |
|
|
94
125
|
| Ruby | CRuby WASI | Yes | syntax | - |
|
|
95
126
|
| Haskell | ghc-in-browser | Yes | syntax | - |
|
|
96
127
|
| LFortran | LFortran LLVM evaluator (experimental) | Yes | compiler diagnostics | - |
|
|
128
|
+
| Lean 4 | Lean 4.34.1 lean --run (Emscripten) | Yes | compiler diagnostics | - |
|
|
97
129
|
| Fortran | f2c + @wasm-idle/llvm-core | Yes | Fortran LSP | - |
|
|
98
130
|
| COBOL | GnuCOBOL 3.2 + @wasm-idle/llvm-core | Yes | syntax | - |
|
|
99
131
|
| V | V 0.5.2 + @wasm-idle/llvm-core | Yes | syntax | - |
|
|
@@ -213,6 +245,7 @@ multi-module guests, and Rust WASI Preview 2/3 debugging remain outside the supp
|
|
|
213
245
|
|
|
214
246
|
```sh
|
|
215
247
|
cd ../wasm-llvm
|
|
248
|
+
WASM_LLVM_CLANG_ARTIFACT_DIR=/path/to/verified-clang-artifacts \
|
|
216
249
|
WASM_LLVM_LLDB_ARTIFACT_DIR=/path/to/lldb-artifacts \
|
|
217
250
|
WASM_LLVM_WAMR_ARTIFACT_DIR=/path/to/wamr-artifacts \
|
|
218
251
|
pnpm prepare:clang-release
|
|
@@ -222,9 +255,16 @@ WASM_RUST_PRODUCER_OUTPUT_ROOT=/path/to/rust-producer-output \
|
|
|
222
255
|
pnpm --dir runtimes/wasm-rust build:producer
|
|
223
256
|
pnpm sync:wasm-rust
|
|
224
257
|
pnpm sync:wasm-debug ../wasm-llvm/out/clang-browser
|
|
225
|
-
|
|
258
|
+
pnpm test:browser:debug:lldb
|
|
226
259
|
```
|
|
227
260
|
|
|
261
|
+
The Clang artifact directory must contain the verified build receipt and its matching raw-input
|
|
262
|
+
identities. The producer rejects historical artifacts without that evidence when assembling a new
|
|
263
|
+
release. For the already reviewed bundled debugger, use `pnpm prepare:wasm-debug-release` in
|
|
264
|
+
`wasm-idle` to install the immutable release selected by the tracked profile.
|
|
265
|
+
The browser command uses the qualified preview path; development-server LLDB qualification is
|
|
266
|
+
tracked separately.
|
|
267
|
+
|
|
228
268
|
The synchronized manifest rejects missing hashes, incompatible Clang/LLDB revisions, and stale
|
|
229
269
|
worker sidecars. The strict browser test covers real C, C++, and Rust breakpoint, step, output, and
|
|
230
270
|
termination paths and rejects trace fallback or a missing debug asset. The Rust producer build is
|
|
@@ -252,10 +292,10 @@ variables or import SvelteKit modules.
|
|
|
252
292
|
| Malbolge<br>`MALBOLGE` | Original Ben Olmstead interpreter, TryItOnline/malbolge b0869870 (public domain), compiled with WASI SDK 33 | Runs the original 59049-cell ternary and self-modifying interpreter; source-file input is separate from byte stdin/stdout; EOF stores 59048; requires at least two non-whitespace source bytes | `runtimeAssets.rootUrl`, `stdin`, `activePath`, `workspaceFiles`; fixed interpreter argv; prepare compiles the runtime without executing or validating the source |
|
|
253
293
|
| Whitespace<br>`WHITESPACE` | koturn/Whitespace 22a57aab (MIT), compiled with WASI SDK 33 | Runs the upstream Whitespace 0.3 interpreter with a documented divisor-guard correction, copy/slide, heap, labels, calls and signed 32-bit integers; character/numeric stdin and exact stdout; character EOF is -1; source limit 65535 UTF-8 bytes | `runtimeAssets.rootUrl`, `stdin`, `activePath`, `workspaceFiles`; fixed interpreter argv; prepare compiles the runtime without executing or validating the source |
|
|
254
294
|
| 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 |
|
|
255
|
-
| C<br>`C` | @wasm-idle/llvm-core@1.0.
|
|
256
|
-
| C++<br>`CPP` | @wasm-idle/llvm-core@1.0.
|
|
257
|
-
| Objective-C<br>`OBJC` | GNUstep libobjc2 v2.3 assets from the `wasm-llvm` producer + @wasm-idle/llvm-core@1.0.
|
|
258
|
-
| Objective-C++<br>`OBJECTIVECXX` | Same GNUstep libobjc2 v2.3 + libc++ assets as Objective-C from the `wasm-llvm` producer + @wasm-idle/llvm-core@1.0.
|
|
295
|
+
| C<br>`C` | @wasm-idle/llvm-core@1.0.11 / 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` |
|
|
296
|
+
| C++<br>`CPP` | @wasm-idle/llvm-core@1.0.11 / 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` |
|
|
297
|
+
| Objective-C<br>`OBJC` | GNUstep libobjc2 v2.3 assets from the `wasm-llvm` producer + @wasm-idle/llvm-core@1.0.11 | `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` |
|
|
298
|
+
| Objective-C++<br>`OBJECTIVECXX` | Same GNUstep libobjc2 v2.3 + libc++ assets as Objective-C from the `wasm-llvm` producer + @wasm-idle/llvm-core@1.0.11; no extra compiler assets | `clang -x objective-c++ -std=gnu++20 -fobjc-runtime=gnustep-2.0 -fblocks` for `wasm32-wasi` with libc++ headers; active file defaults to `main.mm`; links `libobjc.a` (plus GNUstep Base and `libffi.a` when Foundation is imported); auto-compiles `.mm`/`.m`/`.c` workspace files; supports `stdin` and `programArgs`; trace debugging is not supported | Shares `runtimeAssets.objectivec` and `runtimeAssets.clang` with Objective-C; `activePath`, `workspaceFiles`, `compileArgs`, `programArgs` |
|
|
259
299
|
| Python<br>`PYTHON3` | static ESM `static/pyodide/pyodide.mjs` / pyodide@314.0.7 | loads `pyodide.mjs`, `pyodide.asm.mjs`, `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` |
|
|
260
300
|
| Befunge-93<br>`BEFUNGE93` | catseye/Befunge-93 8fe4065c (BSD-3-Clause), compiled with WASI SDK 33 | Runs the original interpreter with an 80 by 25 wrapping playfield, signed 32-bit stack, string mode and self-modifying p/g instructions; character and integer stdin share the WASI terminal; character EOF is -1 | `runtimeAssets.rootUrl`, `stdin`, `activePath`, `workspaceFiles`; fixed quiet argv; prepare compiles the runtime without executing or validating the source |
|
|
261
301
|
| Brainfuck<br>`BRAINFUCK` | susam/bfc b1b92fc (MIT), compiled with WASI SDK 33 | Runs the pinned upstream interpreter in a browser Worker with a fresh read-only source filesystem; 30000 wrapping 8-bit cells, UTF-8 byte stdin/stdout, EOF sets the cell to zero | `runtimeAssets.rootUrl`, `stdin`, `activePath`, `workspaceFiles`; fixed interpreter argv; prepare compiles the runtime without executing or validating the source |
|
|
@@ -296,12 +336,14 @@ variables or import SvelteKit modules.
|
|
|
296
336
|
| Fennel<br>`FENNEL` | static wasm-fennel `fennel-1.6.1.lua.gz` (official Fennel 1.6.1) on wasm-lua@0.1.0 | receipt-verified `fennel.lua` compiler evaluated by the Wasmoon Lua VM; supports `stdin` and `programArgs` | `runtimeAssets.fennel.compilerUrl` or `PUBLIC_WASM_FENNEL_COMPILER_URL` plus the Lua module URL; `programArgs` |
|
|
297
337
|
| 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` |
|
|
298
338
|
| 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` |
|
|
339
|
+
| Common Lisp<br>`COMMONLISP` | receipt-pinned `wasm-llvm/producer/ecl-browser` ECL 26.5.5 artifacts downloaded into `static/wasm-commonlisp` | real upstream ECL bytecode compiler/interpreter LOADs the active file in a fresh Worker; shared-ring stdin serves READ-LINE/READ with EOF; unhandled conditions print to stderr and fail the run; recursion deeper than the browser call stack (about 150 levels in a Chromium Worker) fails as a stack-overflow error | `runtimeAssets.commonlisp.baseUrl` relocates the reviewed bundle; `stdin`, `activePath`, workspace files loadable with `LOAD`, cancellation and Wasm memory limits; no program arguments, native compiler or contrib modules |
|
|
299
340
|
| Ruby<br>`RUBY` | receipt-pinned `static/wasm-ruby` profile produced from @ruby/3.4-wasm-wasi@2.10.1 + @ruby/wasm-wasi@2.10.1 | 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` |
|
|
300
341
|
| 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` |
|
|
301
342
|
| 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 |
|
|
302
|
-
|
|
|
303
|
-
|
|
|
304
|
-
|
|
|
343
|
+
| Lean 4<br>`LEAN4` | receipt-pinned `wasm-llvm/producer/lean-browser` release downloaded from its immutable commit into `static/wasm-lean4` | real Lean 4.34.1 frontend and IR interpreter (`lean --run`) built for wasm32 Emscripten with pthreads; imports a wasm32 `Init` library compiled by that build; shared-ring stdin supports interactive `getLine` and EOF | `runtimeAssets.lean4.baseUrl` relocates the reviewed bundle; `stdin`, program arguments, `activePath`, cancellation and execution limits; single-file programs importing `Init` only (no `Std`/`Lean` imports or Lake packages) |
|
|
344
|
+
| Fortran<br>`FORTRAN` | Netlib f2c 2022-09-09 + `@cowasm/f2c 1.0.0` libf2c + @wasm-idle/llvm-core@1.0.11 | 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` |
|
|
345
|
+
| COBOL<br>`COBOL` | GnuCOBOL 3.2 + GMP 6.3.0 assets from the `wasm-llvm` producer + @wasm-idle/llvm-core@1.0.11 | 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` |
|
|
346
|
+
| V<br>`V` | V 0.5.2 compiler, vlib and WASI C sysroot assets from the `wasm-llvm` producer + @wasm-idle/llvm-core@1.0.11 | native gzip delivery for the compiler Wasm and filesystem tar assets; translates V to C with the real V compiler (built from the upstream `vc` bootstrap for WASI), compiles the generated C with the llvm-core Clang host, and executes the resulting WASI module with `stdin` and `programArgs` | `runtimeAssets.v.baseUrl` or `PUBLIC_WASM_V_BASE_URL`; `runtimeAssets.clang.baseUrl`/`loader` for the C backend; `activePath`, `workspaceFiles`, `compileArgs` |
|
|
305
347
|
| 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` |
|
|
306
348
|
| 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_*` |
|
|
307
349
|
| DuckDB<br>`DUCKDB` | static ESM `static/wasm-duckdb/runtime.mjs` produced from @duckdb/duckdb-wasm@1.33.1-dev57.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` |
|
|
@@ -346,19 +388,25 @@ toolchains can be consumed from pinned external runtime repositories:
|
|
|
346
388
|
- `packages/react`: React hooks around `@wasm-idle/core`.
|
|
347
389
|
- `packages/vue`: Vue composables around `@wasm-idle/core`.
|
|
348
390
|
- `packages/node`: Node.js host helpers for Node-capable sandbox loaders.
|
|
349
|
-
- `runtimes/*`: imported runtime/compiler packages
|
|
350
|
-
`wasm-
|
|
351
|
-
`wasm-
|
|
352
|
-
`
|
|
353
|
-
|
|
391
|
+
- `runtimes/*`: imported runtime/compiler packages `wasm-rust`, `wasm-of-js-of-ocaml`, `wasm-go`,
|
|
392
|
+
`wasm-d`, `wasm-dotnet`, `wasm-typescript`, `wasm-wat`, `wasm-lua`, `wasm-lisp`, `wasm-elixir`,
|
|
393
|
+
`wasm-awk`, `wasm-bash`, `wasm-clojurescript`, `pyodide`, `teavm`, `ruby`, `r`, and
|
|
394
|
+
`js-sandbox`. `wasm-pascal` holds the pas2js compiler wrapper sources and is not a workspace
|
|
395
|
+
package.
|
|
396
|
+
- `runtimes/esolangs`: pinned upstream interpreter sources and licenses for the esoteric
|
|
397
|
+
languages. `pnpm build:esolangs` and the Aheui, APECode, and GolfScript sync scripts turn them
|
|
398
|
+
into `static/wasm-<language>/` assets.
|
|
354
399
|
- `runtimes/wasm-tinygo`: the public `TINYGO` browser compiler consumer plus an explicitly labeled
|
|
355
400
|
legacy AST-to-C development harness. Static releases publish only the receipt-verified upstream
|
|
356
401
|
consumer and its source-pinned toolchain assets.
|
|
402
|
+
- `runtimes/wasm-kotlin` and `runtimes/wasm-scala`: internal compiler candidates. They are not
|
|
403
|
+
registered playground languages or workspace packages.
|
|
357
404
|
- `producers/wasm-php`: standalone, locked producer for the checked-in PHP 8.4 page asset. It is
|
|
358
405
|
outside the root workspace and is never published as an npm package.
|
|
359
|
-
- `static/wasm-zig`, `static/wasm-haskell`, `static/wasm-julia`,
|
|
360
|
-
|
|
361
|
-
|
|
406
|
+
- `static/wasm-zig`, `static/wasm-haskell`, `static/wasm-julia`, `static/wasm-nim`,
|
|
407
|
+
`static/wasm-tcl`, `static/wasm-forth`, `static/wasm-j`, `static/wasm-bqn`, and
|
|
408
|
+
`static/wasm-janet`: bundled browser runtime and compiler assets synced from upstream asset
|
|
409
|
+
builds rather than local workspace packages.
|
|
362
410
|
|
|
363
411
|
Deployment builds retain both legacy `.gz` and canonical `.gz.bin` URLs by default.
|
|
364
412
|
After building and compressing the page, `pnpm run compact:build-runtimes` reports
|
|
@@ -381,9 +429,24 @@ pnpm sync:runtime list
|
|
|
381
429
|
pnpm sync:runtimes
|
|
382
430
|
```
|
|
383
431
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
432
|
+
`pnpm sync:runtime list` prints every runtime the wrapper knows. It marks `manual` runtimes, which
|
|
433
|
+
`pnpm sync:runtimes` skips unless `--include-manual` is passed, and `source-required` runtimes,
|
|
434
|
+
which need an explicit source directory and never run from `sync:runtimes`.
|
|
435
|
+
|
|
436
|
+
Default sources differ by runtime:
|
|
437
|
+
|
|
438
|
+
- Runtimes with sources under `runtimes/`, such as `wasm-go`, `wasm-d`, `wasm-dotnet`,
|
|
439
|
+
`wasm-lua`, `wasm-wat`, `wasm-typescript`, `wasm-lisp`, `wasm-awk`, `wasm-pascal`, and
|
|
440
|
+
`wasm-bash`, read `runtimes/<name>/dist`.
|
|
441
|
+
- Some read an installed npm package, such as `webr` or `swipl-wasm`.
|
|
442
|
+
- Some download a pinned upstream release, such as Tcl, Perl, and Octave.
|
|
443
|
+
- Julia and Nim re-verify the checked-in assets and download their pinned release only when those
|
|
444
|
+
assets are missing.
|
|
445
|
+
- J, BQN, and Janet prefer a sibling checkout and otherwise reuse the checked-in assets.
|
|
446
|
+
- Rust, TinyGo, and ClojureScript re-verify and redeploy the checked-in `static/` snapshot.
|
|
447
|
+
|
|
448
|
+
The optional `[sourceDir] [targetDir]` arguments override these defaults. `sync:wasm-php` is not
|
|
449
|
+
part of the wrapper; it consumes `producers/wasm-php/dist` or `WASM_IDLE_WASM_PHP_DIST`.
|
|
387
450
|
|
|
388
451
|
Published packages are built in workspace dependency order. Before publishing, run:
|
|
389
452
|
|
|
@@ -408,7 +471,7 @@ opaque, receipt-pinned storage paths; these files are deployed page assets, not
|
|
|
408
471
|
contents.
|
|
409
472
|
|
|
410
473
|
PHP is built independently under `producers/wasm-php`, with its own lockfile and exact
|
|
411
|
-
`@php-wasm/web-8-4@3.1.
|
|
474
|
+
`@php-wasm/web-8-4@3.1.57` and `@php-wasm/universal@3.1.57` dependencies. Refresh the checked-in
|
|
412
475
|
page asset only when changing that producer:
|
|
413
476
|
|
|
414
477
|
```bash
|
|
@@ -470,15 +533,26 @@ cd wasm-idle
|
|
|
470
533
|
pnpm run sync:wasm-julia
|
|
471
534
|
```
|
|
472
535
|
|
|
473
|
-
Nim
|
|
536
|
+
Nim compiler preparation is owned by `wasm-llvm/producer/nim-browser`; the pinned
|
|
537
|
+
`benagastov/Nim-WASM-Compiler` distribution is delivered under
|
|
474
538
|
`static/wasm-nim/`: Nim 2.2.4 compiled to WebAssembly emits C, then bundled clang/lld WebAssembly
|
|
475
|
-
assets link a runnable WASI module.
|
|
539
|
+
assets link a runnable WASI module. Package the compiler artifacts with the producer,
|
|
540
|
+
then publish the verified bundle and current consumer Worker:
|
|
476
541
|
|
|
477
542
|
```bash
|
|
478
|
-
|
|
479
|
-
pnpm
|
|
543
|
+
# In wasm-llvm: migrate existing verified assets or select a pinned upstream source.
|
|
544
|
+
pnpm package:nim -- --from-runtime /path/to/wasm-idle/static/wasm-nim --out out/nim-browser
|
|
545
|
+
# In wasm-idle:
|
|
546
|
+
pnpm sync:wasm-nim /path/to/wasm-llvm/out/nim-browser
|
|
480
547
|
```
|
|
481
548
|
|
|
549
|
+
D compiler source patches, porting probes and artifact packaging live in
|
|
550
|
+
`wasm-llvm/producer/d-browser`. Import its verified output through
|
|
551
|
+
`WASM_LLVM_D_ARTIFACT_DIR` when building `runtimes/wasm-d`; see [the D browser integration](docs/d-browser.md).
|
|
552
|
+
C3 and LFortran continue using their existing `wasm-llvm` producers. Compiler preparation for
|
|
553
|
+
these four paths belongs to the producer repository, while execution and cache ownership belong
|
|
554
|
+
to `wasm-idle`.
|
|
555
|
+
|
|
482
556
|
## Rust browser integration
|
|
483
557
|
|
|
484
558
|
The demo app publishes the workspace `wasm-rust` compiler as a receipt-pinned executable graph
|
|
@@ -584,6 +658,9 @@ browser UI thread.
|
|
|
584
658
|
C3 local asset setup, byte I/O ABI, and its 1 GiB default memory budget are documented in
|
|
585
659
|
[C3 browser integration](docs/c3-browser.md).
|
|
586
660
|
|
|
661
|
+
Common Lisp (ECL) asset download, stdin behaviour and limits are documented in
|
|
662
|
+
[Common Lisp browser integration](docs/commonlisp.md).
|
|
663
|
+
|
|
587
664
|
Grain's pinned upstream compiler, stdin model, and asset refresh are documented in
|
|
588
665
|
[Grain browser integration](docs/grain-browser.md).
|
|
589
666
|
|
|
@@ -617,7 +694,8 @@ are bounded and verified against the exact expanded size and SHA-256.
|
|
|
617
694
|
|
|
618
695
|
The preparer rejects source or target paths outside their configured roots, checks each redirect
|
|
619
696
|
before following it, writes atomically, and reuses only matching files. With no group argument,
|
|
620
|
-
it prepares
|
|
697
|
+
it prepares the Clang delivery bundle with its matching clangd assets, the complete OCaml browser
|
|
698
|
+
compiler graph, and the C3, LFortran, Lean 4, and Common Lisp payloads.
|
|
621
699
|
`WASM_IDLE_TEST_ASSET_BASE_URL` can select a compatible mirror with the same receipt-verified bytes.
|
|
622
700
|
For protected local browser tests, provide `WASM_IDLE_TEST_BYPASS_COOKIE` through the environment
|
|
623
701
|
in `dev_bypass_waf=<value>` form; the browser cookie jar scopes it to the test origin. Asset
|
|
@@ -776,8 +854,8 @@ and other workspace `.sql` files run first. Preloaded stdin is exposed as the se
|
|
|
776
854
|
`/dev/blob` (`COPY t FROM '/dev/blob'` or `pg_read_file('/dev/blob')`). Override the module with
|
|
777
855
|
`PUBLIC_WASM_POSTGRESQL_MODULE_URL` or `runtimeAssets.postgresql.moduleUrl`.
|
|
778
856
|
PHP dynamically imports the checked-in `static/wasm-php/runtime.mjs` output from the standalone
|
|
779
|
-
`producers/wasm-php` build. That producer pins `@php-wasm/web-8-4@3.1.
|
|
780
|
-
`@php-wasm/universal@3.1.
|
|
857
|
+
`producers/wasm-php` build. That producer pins `@php-wasm/web-8-4@3.1.57` and
|
|
858
|
+
`@php-wasm/universal@3.1.57`. It always creates PHP 8.4; there is no version field or
|
|
781
859
|
environment-based version selector. Override only the module location with
|
|
782
860
|
`PUBLIC_WASM_PHP_MODULE_URL` or `runtimeAssets.php.moduleUrl`. A custom host must serve the entry's
|
|
783
861
|
sibling chunks and assets with compatible CORS and cross-origin isolation headers; a cross-origin
|
|
@@ -845,6 +923,9 @@ the Rust worker:
|
|
|
845
923
|
|
|
846
924
|
- `wasm32-wasip1` runs as preview1 core wasm through `@bjorn3/browser_wasi_shim`
|
|
847
925
|
- `wasm32-wasip2` runs as a preview2 component through `preview2-shim` plus transpiled `jco` output
|
|
926
|
+
- `wasm32-wasip3` also returns a component and runs on the same preview2 path. This works only
|
|
927
|
+
while emitted components keep transitional WASIp2 imports; preview3 imports are rejected until a
|
|
928
|
+
browser preview3 shim exists
|
|
848
929
|
|
|
849
930
|
C-family compilation remains hosted by `@wasm-idle/llvm-core`, while Rust delegates artifact
|
|
850
931
|
execution to `wasm-rust` so the selected target and returned artifact format stay aligned.
|
|
@@ -907,7 +988,9 @@ const runtimeAssets: PlaygroundRuntimeAssets = {
|
|
|
907
988
|
stdlibUrl: 'https://cdn.example.com/wasm-zig/std.tar.gz'
|
|
908
989
|
},
|
|
909
990
|
lisp: {
|
|
910
|
-
moduleUrl: 'https://cdn.example.com/wasm-lisp/index.js'
|
|
991
|
+
moduleUrl: 'https://cdn.example.com/wasm-lisp/index.js',
|
|
992
|
+
manifestUrl: 'https://cdn.example.com/wasm-lisp/runtime-manifest.v2.json',
|
|
993
|
+
manifestFingerprint: '<runtime-manifest-fingerprint>'
|
|
911
994
|
},
|
|
912
995
|
haskell: {
|
|
913
996
|
moduleUrl: 'https://cdn.example.com/wasm-haskell/dyld.mjs',
|
|
@@ -916,7 +999,9 @@ const runtimeAssets: PlaygroundRuntimeAssets = {
|
|
|
916
999
|
},
|
|
917
1000
|
nim: {
|
|
918
1001
|
baseUrl: 'https://cdn.example.com/wasm-nim/',
|
|
919
|
-
workerUrl: 'https://cdn.example.com/wasm-nim/runner-worker.js'
|
|
1002
|
+
workerUrl: 'https://cdn.example.com/wasm-nim/runner-worker.js',
|
|
1003
|
+
// Complete identity and receipt bundle for the served bytes; see below.
|
|
1004
|
+
...nimTrustBundle
|
|
920
1005
|
}
|
|
921
1006
|
};
|
|
922
1007
|
```
|
|
@@ -924,12 +1009,22 @@ const runtimeAssets: PlaygroundRuntimeAssets = {
|
|
|
924
1009
|
Static module overrides such as PHP's `moduleUrl` identify an entry module, not a self-contained
|
|
925
1010
|
file. Mirror its complete sibling asset tree at the same relative paths. Cross-origin asset hosts
|
|
926
1011
|
must provide compatible CORS and COEP/CORP headers and cannot rely on wasm-idle's same-origin gzip
|
|
927
|
-
service worker.
|
|
1012
|
+
service worker. The checkout stores several files from the example above only as `.gz`, for
|
|
1013
|
+
example `wasm-zig/zig_small.wasm.gz`, `wasm-wat/index.js.gz`, `wasm-lisp/index.js.gz`, and
|
|
1014
|
+
`wasm-haskell/bsdtar.wasm.gz`. A host for those URLs must return the decompressed bytes, either as
|
|
1015
|
+
a decompressed file or as that `.gz` served with `Content-Encoding: gzip`; Zig's `std.tar.gz` is
|
|
1016
|
+
served as stored.
|
|
928
1017
|
|
|
929
1018
|
Verified static runtimes such as Janet and Julia intentionally omit URL-only examples: a custom
|
|
930
1019
|
`baseUrl`, `manifestUrl`, or `workerUrl` must be accompanied by every identity and asset-receipt
|
|
931
1020
|
field declared by that runtime's asset config, including the matching `workerReceipt`. Partial
|
|
932
|
-
trust bundles fail closed instead of borrowing receipts from bundled executable bytes.
|
|
1021
|
+
trust bundles fail closed instead of borrowing receipts from bundled executable bytes. In the Nim
|
|
1022
|
+
entry above, `nimTrustBundle` stands for `profileId`, `artifactRevision`, `nimRevision`,
|
|
1023
|
+
`llvmRevision`, `memfsRevision`, `emscriptenRevision`, `manifestFingerprint`, `manifestReceipt`,
|
|
1024
|
+
`nimJavaScriptReceipt`, `nimWasmReceipt`, `nimbaseReceipt`, `clangJavaScriptReceipt`,
|
|
1025
|
+
`clangWasmReceipt`, `lldWasmReceipt`, `memfsWasmReceipt`, `sysrootReceipt`, and `workerReceipt`. An
|
|
1026
|
+
explicit Nim `manifestUrl` must be `runtime-manifest.v2.json?v=<manifestFingerprint>` under
|
|
1027
|
+
`baseUrl`. A `rootUrl` mirror of the bundled Nim files needs no `nim` entry.
|
|
933
1028
|
|
|
934
1029
|
The bundled C/C++ app uses receipt-pinned Clang language sysroots: C initially downloads only the
|
|
935
1030
|
C base, while C++ or a mixed/opaque-language build loads the C++ add-on before compiling or linking.
|
|
@@ -980,8 +1075,8 @@ The pack contains the same locked upstream files, not an import-based subset. Ea
|
|
|
980
1075
|
### Retaining compiler caches across editor navigation
|
|
981
1076
|
|
|
982
1077
|
Create one `createRuntimeSession(assets)` owner per browser application and use
|
|
983
|
-
`session.createBinding()` for each editor or execution panel.
|
|
984
|
-
|
|
1078
|
+
`session.createBinding()` for each editor or execution panel. Clang consumers, Rust,
|
|
1079
|
+
TinyGo, D, C3, Nim, LFortran and Python share a bounded owner for verified assets and compiler modules:
|
|
985
1080
|
|
|
986
1081
|
```ts
|
|
987
1082
|
import { createRuntimeSession } from 'wasm-idle';
|
|
@@ -995,12 +1090,14 @@ await panel.dispose(); // close this panel; retain the session's cache
|
|
|
995
1090
|
|
|
996
1091
|
const nextPanel = session.createBinding(); // another problem, same language
|
|
997
1092
|
await nextPanel.load('PYTHON');
|
|
998
|
-
await session.selectLanguage('CPP'); // release old-language panels
|
|
1093
|
+
await session.selectLanguage('CPP'); // release old-language panels; retain verified assets
|
|
999
1094
|
await session.dispose(); // full, terminal release of this owner
|
|
1000
1095
|
```
|
|
1001
1096
|
|
|
1002
|
-
Selecting a language does not download assets.
|
|
1003
|
-
|
|
1097
|
+
Selecting a language does not download assets. Only the selected language keeps active
|
|
1098
|
+
execution leases; verified compiler assets survive language changes until LRU eviction
|
|
1099
|
+
or session disposal. Selecting an unsupported/server-only language releases active leases
|
|
1100
|
+
without clearing the session's verified assets.
|
|
1004
1101
|
Executions never share mutable Wasm instances, user files or stdin. C/C++ additionally
|
|
1005
1102
|
reuse compiled programs when source, workspace and compiler options match, while
|
|
1006
1103
|
custom loaders and debugging retain the original execution path. Python still creates
|
|
@@ -1009,7 +1106,23 @@ a fresh interpreter after `clear()`; module reuse does not eliminate interpreter
|
|
|
1009
1106
|
The asset cache is LRU-bounded to 64 entries and 256 MiB of logical asset bytes
|
|
1010
1107
|
(not a measurement of the browser engine's compiled-code memory). C/C++ program
|
|
1011
1108
|
artifacts are independently bounded to 8 entries and 32 MiB. `getCacheStats()` exposes
|
|
1012
|
-
cache counters for diagnostics.
|
|
1109
|
+
cache counters for diagnostics. COBOL, Fortran, V and Objective-C/Objective-C++ connect
|
|
1110
|
+
their Clang asset bridges to this same owner. Rust, TinyGo, D, C3, Nim and LFortran use one-shot MessagePorts
|
|
1111
|
+
to request compiler modules from the session after checking the pinned artifact receipt.
|
|
1112
|
+
The host verifies the bytes again before returning a module, including on cache hits.
|
|
1113
|
+
Nim also passes verified Clang, LLD and MemFS modules to its nested compiler Worker.
|
|
1114
|
+
C3 partitions its transformed compiler by the configured memory cap; LFortran shares
|
|
1115
|
+
its compiler module while generating fresh dynamic side modules in each execution.
|
|
1116
|
+
Cache identities include artifact receipts, authorization profiles and compilation
|
|
1117
|
+
settings; TinyGo also separates the memory-cap transformation used for each toolchain.
|
|
1118
|
+
|
|
1119
|
+
`@wasm-idle/core` exports `WorkerSession`, `RuntimeAssetCache` and the
|
|
1120
|
+
`createRuntimeWasmModuleService` / `serveRuntimeWasmModule` / `requestRuntimeWasmModule`
|
|
1121
|
+
helpers for hosts implementing the same ownership model. Cancelling one request closes
|
|
1122
|
+
its subscription without terminating another request that uses the same immutable
|
|
1123
|
+
module. Compiler instances, linear memory, files and compiler helper threads remain
|
|
1124
|
+
owned by individual jobs; this cache does not combine the LLVM binaries embedded in
|
|
1125
|
+
different toolchains.
|
|
1013
1126
|
|
|
1014
1127
|
### Optional idle runtime prewarming
|
|
1015
1128
|
|
|
@@ -256,6 +256,8 @@ export function createApplicationRuntimeAssets(rootUrl) {
|
|
|
256
256
|
integrity: HASKELL_RUNTIME_ASSET_RECEIPTS
|
|
257
257
|
},
|
|
258
258
|
lfortran: { baseUrl: asset('wasm-lfortran/') },
|
|
259
|
+
lean4: { baseUrl: asset('wasm-lean4/') },
|
|
260
|
+
commonlisp: { baseUrl: asset('wasm-commonlisp/') },
|
|
259
261
|
fortran: {
|
|
260
262
|
baseUrl: asset('wasm-fortran/'),
|
|
261
263
|
f2cWasmUrl: asset('wasm-fortran/f2c.wasm', WASM_FORTRAN_EXECUTION_ASSET_VERSION),
|