logoalt Hacker News

hansvm • yesterday at 9:45 PM • 1 reply • view on HN

Zig isn't perfect, but I've definitely done this futamura stuff before. It's one of my favourite ways to implement a Forth in Zig (which, incidentally, is the default way that I introduce a backprop library or other DSL as I'm prototyping an idea). Interpreters are dead-simple to write, and I just write an interpreter with a comptime code argument. It definitely works, and the codegen is reasoanble out of the box.


Replies

speedster217 • yesterday at 11:02 PM

Thanks for the input! I was thinking about trying this out in Zig. The whole article reminded me of why I was originally excited about comptime