Re:Why Zig when there is already C++, D, and Rust?
by MaxBarraclough on Friday January 15, 2021 @07:41PM
(#25798664)
You could go for productivity, but that's not the only dimension. You could emphasise safety: C++ has no equivalent to Rust's safe subset. I believe D has a safe subset too, but I don't think Zig does. You could emphasise portability: C++ seems like the clear winner in terms of having the most supported platforms.
[ Parent
| on HN ]
Re:Why Zig when there is already C++, D, and Rust?
by pjmlp on Saturday January 16, 2021 @04:38AM
(#25801200)
Microsoft and Google are trying to retrofit a safe subset into C++, via the Core Guidelines and lifetimes, enforced via static analysers.
Since C++ is more relevant to what I do, naturally I keep validating how good they fair and so far not good.
Lifetimes checker for example, is only able to deal with basic workflows and when it complains the error messages aren't that good, leaving you wonder why the analyser considered it an incorrect lifetime.
Main reason being, if the call sites aren't annotated, it can only guess the lifetime use, and mostly it gets it wrong.
No doubt if they keep throwing money at it, they might eventually solve it, however this is already a three year effort and this is the best so far.
Re:Why Zig when there is already C++, D, and Rust?
by MaxBarraclough on Saturday January 16, 2021 @06:29AM
(#25801603)
It's also possible to formally verify C++, [0][1] but this isn't commonly done. I imagine it's very labour intensive.