Hacker News new | ask | show | jobs
by dsp_person 668 days ago
> I wish there was a way to get Zig code out of comptime

I often just take an approach similar to cog [1], but it's simple enough I prefer to roll my own to do whatever code generation I'm wanting. E.g. write a ~100 line python file that reads source file(s), reads special comments with code gen or introspection instructions, and then insert generated code at some designated point(s).

[1] https://github.com/nedbat/cog