top | item 47160887

(no title)

don-bright | 4 days ago

thats so awesome. i wonder what a live forth interpreter would look like on NES.

discuss

order

tombert|4 days ago

A live interpreter turns out to be very slow! It's still useful but it's about 1/10th the speed of the compiled version. I've mostly just been using it to play with placement and test out my ppu logic. Honestly a lot of the work is being handled by BizHawk.

The compiler is pretty neat though; my current system is doing a straightforward conversion of the threaded-code quasi-AST thing that Forth does and convert it all to JSR calls, where each name is a subroutine. I haven't done a ton of optimizations yet, so I'm actually surprised it's going as fast as it is. I am just going to say this is yet another "Forth is awesome" thing.

Once I get it into a more stable state, I'll push it up to SourceHut.