4 ms·
> Simplicity. Zig has no macros and no metaprogramming This one is an odd point; this very article is a demonstration of metaprogramming*: > Thanks to Zig’s t
by b3morales 4y ago
> Simplicity. Zig has no macros and no metaprogramming
This one is an odd point; this very article is a demonstration of metaprogramming*:
> Thanks to Zig’s type reflection we can read a row of data into a user-provided type without needing to write any “mapping” function: we know the type we want to read (here the User struct) and can analyse it at compile-time.
* Which is a feature I favor, for the record.
- throwawaymaths 4y agoI think the poster meant "no macros" (and especially no c-style lexical macros)
- formerly_proven 4y agoNo metaprogramming as in no separate metalanguage (e.g. templates, macro_rules!)
- avgcorrection 4y agoHomogeneous metaprogramming is a thing...