feat: wire up run button — compile fink to wasm and execute#19
Merged
Conversation
- 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)
|
This PR will release v1.12.0 |
|
🎉 This PR is included in version 1.12.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codegenfeature to newcompiler+watsplitcompile()wasm-bindgen export in the playground crate (parse → CPS → lift → codegen)setCompileModule()incompiler.tsso the run button delegates to the crate once WASM is loadedWebAssembly.instantiaterunner — fink codegen exportsfink_main(entry, no params) andresult(i32 global); no WASI imports needed yetCompile error: ...) from runtime traps (Runtime error: ...) in the run button handlerTest plan
main = fn:\n 1 + 2and click Run → output shows3Compile error: ...