3 ms·
Can it be used as a interpreter once compiled to not need a compiler?
by koolala 1y ago
Can it be used as a interpreter once compiled to not need a compiler?
- wk_end 1y agoJust eyeballing it really quickly, it doesn’t look like it’s got the built-ins you’d want to quickly built a REPL (i.e. read or eval). It’s not really Scheme, yet. It’s written in C, so you could compile that to wasm and then compile & run all inside the browser (I guess, assuming wasm is cool with that sort of thing, not a wasm guy here).
- circuit10 1y agoYou can do that kind of JIT code generation with WASM but you need to compile a separate module and load and link things up in JS (doable but not technically within pure WASM, so it won’t work in standalone runtimes)
- shakna 1y agoThis isn't quite a standards conforming Scheme just yet. On the other hand, Hoot supports WASM-GC on release [0], and has had wasm support for a few years now. (Though Safari support has been a pain point - they've found a few bugs in WebKit's wasm support.) [0] https://spritely.institute/news/hoot-0-6-1-released.html https://spritely.institute/news/hoot-0-6-1-released.html
- davexunit 1y agoThankfully, Safari and iOS now have the necessary bug fixes to run wasm binaries generated by hoot without issue.
- kreelman 1y agoI couldn't find evidence of an interpreter on the scm2wasm github page, but I only did a shallow look. Hoot (uses Guile Scheme), mentioned above, has a working interpreter, to quote... "The toolchain is self-contained and even features a Wasm interpreter for testing Hoot binaries without leaving the Guile REPL."