Basic MetaProgramming in Zig
openmymind.net> 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).
That was an interesting blog post, hope we will get more intermediate and advance zig usage blog posts and in the future books about zig.
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.
Having seen some strange things done with C, on multiprocessor infrastructure using shared memory alongside home grown RPC framework with handles instead of pointers, or regular demoscene stuff, there is enough room for creative advanced usage even with small languages.
I was more hinting at this books like "Patterns in C" etc. But a more complete use/abuse of zig meta programming would also be nice. Especially for people that have consume more generic code than produce generic code..
Off course one can just hunt down the advance material looking through discord, read the bigger zig codebases etc but having it all in one place a couple of books that describe and explains is just way better to level up and get rid of the skill issue :)
Pattern in C can also be provided. :)
By applying the architecture designs from key references like Edward Yourdon books, which are from the structure architecture wave, that predated the OOP patterns wave.
I like that. Still they have some design issues.