Re:Zig, the Small Language
by WalterBright on Wednesday September 07, 2022 @02:32PM
(#32754397)
D literally has the switches `-release` and `-debug`.
It seems to me that a possible improvement would be for the compiler to error on unreachable code in `-release` and to warn in `-debug`.
Re:Zig, the Small Language
by pwdisswordfish9 on Thursday September 08, 2022 @03:55AM
(#32762620)
Why don’t you fix those bugs?
Re:Zig, the Small Language
by WalterBright on Thursday September 08, 2022 @04:06AM
(#32762706)
-release is in there for magazine journalists who run benchmarks. -debug is for project managers to bring order to special debug code.
I totally get where this is coming from, but on the other hand it seems like Rust and Zig both get a lot of value from having the compiler understand the difference between debug and release modes, and it seems like modern C++ suffers somewhat from not having any built-in way to do something similar. The optimal number of compiler switches might not be zero.