feat(languages): add Rune WASM language support#992
Conversation
✅ Deploy Preview for livecodes ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: +1.99 kB (+0.18%) Total Size: 1.1 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Fixed the CI typecheck failure. The Task list (6/6 completed)
|
Deploying livecodes with
|
| Latest commit: |
4c9a0ad
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b62e5bfc.livecodes.pages.dev |
| Branch Preview URL: | https://pullfrog-991-add-rune-wasm.livecodes.pages.dev |
|
Replied to all 3 SonarCloud review threads. All flagged the same Task list (4/5 completed)
|
|
When running rune code I get this console log |
|
Now I understand the setup. The IIFE build bundles the runtime script as a standalone IIFE. The key issue is:
But looking at the error: The problem is likely that the Wait, let me re-read. The full CDN rune.js starts with After calling But the actual issue: the runtime script is an IIFE bundled with esbuild. The Wait, I think the real issue might be simpler. Let me look at the error message more carefully: Looking at the rune.js source again — The fetch interceptor in the script redirects BUT - looking more carefully at the rune.js init logic: the However, Let me think about what else could go wrong... The key question: after Let Task list (2/5 completed)
|
|
@pullfrog continue |
|
Fixed the Rune WASM The issue was a race condition with Changes in b2fd1b3:
Task list (6/6 completed)
|
With liveReload: true, multiple calls to run() can trigger concurrent rune.init() calls, causing rune.module to remain null and the compile call to fail with "Cannot read properties of null (reading 'compile')". Add a shared initPromise to serialize initialization, and use a stricter check (typeof rune.module?.compile !== 'function') instead of !rune.module to properly verify the module is ready.
|
we need to capture output, exit code, errors, etc |
|
Updated Changes:
Pushed to PR #992. Task list (3/3 completed)
|
|
@pullfrog |
|
Added Rune WASM starter template to PR #992. New files:
Modified:
The template follows the Task list (7/7 completed)
|
|
Rune logo can be found here: https://rune-rs.github.io/img/logo.png use it for starter template |
|
The existing learnings already cover starter template conventions well — logo location, naming, registration, and i18n steps. Nothing substantively new to add.
|
- Pass input from run() to runCode() as injected __input variable - Update starter template to use rune for counter increment (matching csharp-wasm pattern)
|
Task list (5/5 completed)
|
|
@pullfrog Hello, [object Object]! |
|
Fixed three bugs in the Rune WASM starter template and runtime that caused "Hello, [object Object]! You clicked undefined times.":
Task list (3/3 completed)
|
|
@pullfrog |
|
Root cause: The Rune WASM Fix: Updated
Pushed as Task list (5/5 completed)
|
…instead of stringifying The Rune WASM compile() returns a WasmCompileResult object with .output, .result, and .error fields, not a plain string. Calling String(result) on the object produced [object Object]. Extract the correct fields instead.
|
Error: Failed to build rune sources (see diagnostics for details) |
|
The error "Failed to build rune sources" appears to be a runtime error from Rune's WASM compiler, not a build system error. The local build ( Task list (6/6 completed)
|
|
The check suite failure was only the Cloudflare Pages deployment check — it failed instantly (started and completed at the same timestamp), indicating a Cloudflare infrastructure issue rather than a code problem. All code tests pass locally:
Pushed an empty commit ( Task list (5/5 completed)
|
|




Adds support for Rune, a dynamic Rust-like programming language that compiles to WebAssembly, as a new WASM language (
rune-wasmwith aliasesrune,rn).Implementation details
editorLanguagemaps torustfor syntax highlightingliveReload: trueenables incremental code changes without full page reloadFiles
New (3):
src/livecodes/languages/rune-wasm/index.ts— barrelsrc/livecodes/languages/rune-wasm/lang-rune-wasm.ts— language specsrc/livecodes/languages/rune-wasm/lang-rune-wasm-script.ts— patched IIFE runtimeModified (8):
src/livecodes/vendors.ts— CDN URLs for rune.js and WASM binarysrc/sdk/models.ts— Language, TemplateName, and'rust'aliassrc/livecodes/models.ts—'text/rune'scriptTypesrc/livecodes/languages/languages.ts— import and registerscripts/build.js— IIFE entry pointsrc/livecodes/html/language-info.html— language info sectionsrc/livecodes/UI/command-menu-actions.ts— template listsrc/livecodes/i18n/locales/en/language-info.*— i18n keysCloses #991
DeepSeek Pro(free via Pullfrog for OSS) | 𝕏