Skip to content

feat: wire up run button — compile fink to wasm and execute#19

Merged
kollhof merged 1 commit into
mainfrom
feat/run-button
Mar 25, 2026
Merged

feat: wire up run button — compile fink to wasm and execute#19
kollhof merged 1 commit into
mainfrom
feat/run-button

Conversation

@kollhof

@kollhof kollhof commented Mar 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Bumps fink dep v0.1.0 → v0.3.0; maps old codegen feature to new compiler + wat split
  • Adds compile() wasm-bindgen export in the playground crate (parse → CPS → lift → codegen)
  • Wires setCompileModule() in compiler.ts so the run button delegates to the crate once WASM is loaded
  • Replaces the WASI iframe shim with a direct WebAssembly.instantiate runner — fink codegen exports fink_main (entry, no params) and result (i32 global); no WASI imports needed yet
  • Separates compile errors (Compile error: ...) from runtime traps (Runtime error: ...) in the run button handler

Test plan

  • Type main = fn:\n 1 + 2 and click Run → output shows 3
  • Introduce a syntax error → output shows Compile error: ...
  • Verify no console errors on page load

- Bump fink dep v0.1.0 → v0.3.0 with features = ["compiler", "wat"]
  (codegen feature was split into compiler/wat/runner in v0.3.0)
- Add compile() wasm-bindgen export in lib.rs: parse → CPS → lift → codegen
- Implement setCompileModule() in compiler.ts so compile() delegates to
  the playground WASM crate once loaded
- Replace WASI iframe shim with direct WebAssembly.instantiate runner:
  fink codegen exports fink_main (entry) and result (i32 global), no WASI
- Separate compile vs runtime error handling in the run button handler
  (TODO: restore WASI shim once compiler supports IO)
@github-actions

Copy link
Copy Markdown

This PR will release v1.12.0

@kollhof kollhof merged commit c47699d into main Mar 25, 2026
2 checks passed
@kollhof kollhof deleted the feat/run-button branch March 25, 2026 14:53
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant