2 ms·
https://doc.rust-lang.org/std/macro.format.html https://doc.rust-lang.org/std/macro.format.html https://zig.guide/standard-library/formatting/ https://zig.guid
by int_19h 1y ago
https://doc.rust-lang.org/std/macro.format.html https://doc.rust-lang.org/std/macro.format.html
https://zig.guide/standard-library/formatting/ https://zig.guide/standard-library/formatting/
- notmywalrus 1y agoRust is an example of "compiler magic" in this case. You're right about Zig, and reading the source [1] I'm still kind of impressed how unified they made comptime / runtime. [1]: https://github.com/ziglang/zig/blob/32a1aabff78234b428234189ee1093fb65f85fa3/lib/std/Io/Writer.zig#L536 https://github.com/ziglang/zig/blob/32a1aabff78234b428234189...
- int_19h 1y ago"Compiler magic" is generally used to describe things that are built into the compiler; I don't see why macros would qualify. And if they do, then why wouldn't template metaprogramming?