Re:What Makes the Zig Programming Language Unique?
by jcelerier on Thursday October 06, 2022 @09:05AM
(#33107714)
Zig goes a fair bit further than c++ afaik. The ideal would be to be able to call run-time functions indiscriminately at compile-time (e.g. fopen) instead of having to build separate other tools that will generate source code...
[ Parent
| on HN ]
Re:What Makes the Zig Programming Language Unique?
by rurban on Thursday October 06, 2022 @10:00AM
(#33108241)
Though here be dragons: All side-effects evaluated at compile-time, are not run at compile-time!
So fopen, print and all IO or OS functions should be avoided, or even warned. It might be useful in certain edge-cases, but in my 20 years of compile-time programming, it's almost ever a bug, not a feature.