Skip to content

feat: upgrade fink to v0.69.0 and adopt JS interop host shim#23

Merged
kollhof merged 1 commit into
mainfrom
feat/deps-upgrade-3
May 6, 2026
Merged

feat: upgrade fink to v0.69.0 and adopt JS interop host shim#23
kollhof merged 1 commit into
mainfrom
feat/deps-upgrade-3

Conversation

@kollhof

@kollhof kollhof commented May 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Switch the WASM target from Rust interop to the JS interop introduced in fink v0.69.0.
  • Adopt upstream fink.js as the host shim (vendored at build time from the cargo-resolved fink source). Drops hand-rolled host imports and the std/str empty-$ByteArray bootstrap hack.
  • Runner now captures stdout/stderr via host overrides, calls main('playground') if the module exports it, and reports four timing buckets (compile / init / import / run).
  • Crate adapts to the new NodeKind::PostfixOp variant added by fink's open-end-range feature.

Test plan

  • make build clean.
  • Manual: dev server runs a sample program end-to-end; stdout/stderr surface in the output panel; timing breakdown shows.
  • Verify a program exporting main is invoked correctly.
  • Verify panic/trap reporting still works.

Notes

  • host_read is a no-op stub; programs reading stdin will park.
  • Live stdout updates from tight WASM loops are not yet supported (host_channel_send is sync in the JS interop — likely an upstream gap, see chat).

Switch the playground's WASM target from the Rust interop to the new
JS interop landed in fink v0.69.0. Adopt upstream fink.js as the
host shim instead of hand-rolling host imports.

- crate: pin fink = v0.69.0; compile() now uses to_wasm_for(..., Interop::Js).
- crate: handle new NodeKind::PostfixOp in token collection and AST serialization.
- runner: rewrite on top of fink.js init_wasm. Capture stdout/stderr via
  host overrides; if the imported module exports `main`, call it with
  'playground'; otherwise surface the module's last expression.
- runner: split timing into four buckets (compile / init / import / run).
- main: render stdout/stderr panels and the timing breakdown.
- build.mjs: vendor fink.js from the cargo-resolved fink source so the
  shim always matches the pinned crate.
- gitignore: add src/fink.js (vendored at build time); collapse .claude
  patterns into a single .claude rule.
- Makefile: make clean removes src/fink.js.
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

This PR will release v1.16.0

@kollhof kollhof merged commit 82373a2 into main May 6, 2026
2 checks passed
@kollhof kollhof deleted the feat/deps-upgrade-3 branch May 6, 2026 22:40
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.16.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