> 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).
The language is deliberately pretty small. "Advanced usage" will tend to have to do with the problem domain and solution architecture rather than with the language.
dsp_person|1 year ago
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
dragonelite|1 year ago
anonymoushn|1 year ago
unknown|1 year ago
[deleted]