Re:The Magic of Partial Evaluation
by hansvm on Wednesday November 18, 2026 @04:45PM
(#50552568)
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.
[ Parent
| on HN ]
Re:The Magic of Partial Evaluation
by speedster217 on Wednesday November 18, 2026 @06:02PM
(#50553599)
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