Hacker News new | ask | show | jobs
by digdugdirk 931 days ago
Could you please explain a bit about what you mean by how it's compiled? My immediate thought when I saw this was dreaming of a tiny modern lisp repl that I could store in the cloud and run on any computer.

Even pointing to somewhere in the code that I could start poking around would be great.

1 comments

The issue right now is how all WebAssembly modules in general are executed. WASM modules currently must contain everything need to run them when they are built. There is no way to dynamically define a new function or variable after they have been built, which would be required for an Onyx REPL to work.

You could definitely use Onyx to create a modern lisp interpreter that can run in the browser without any dependencies, but it might be worth porting an existing C project if that is your goal. I'm not gonna stop you from making something like that in Onyx tho; it would be very cool!

There is a however possibility for a REPL for Onyx to exist outside of the browser. This is because Onyx has another runtime it can use alongside WASM called OVMwasm. This runtime is entirely custom (you can see the source code in the 'interpreter' folder on the Onyx GitHub), so it could be modified to do non-standard things with WASM, like add new functions dynamically. That would take some work to achieve, but in theory should be possible.