News for hackers. Stuff that matters.
Re:What Makes the Zig Programming Language Unique? by panzi on Thursday October 06, 2022 @12:07AM (#33104272)
No allocations? So you can't do string formatting? Or is that a special case that is somehow supported?
Re:What Makes the Zig Programming Language Unique? by Zen1th on Thursday October 06, 2022 @01:22AM (#33104660)
You can string format using `std.fmt.comptimePrint`[1]. For example, combined with features like `@compileError`[2], it allows you to make your own error messages (useful for generic functions)

[1]: https://ziglang.org/documentation/master/std/#root;fmt.compt... [2]: https://ziglang.org/documentation/master/#compileError