Hacker News new | ask | show | jobs
by Comevius 1455 days ago
The entire point of Zig is that you don't throw that C knowledge out, you turn it into Zig knowledge in 30 minutes.

"If you forget a defer, you will leak memory"

There is a bit more to it than just plastering defer all over. If you are designing something in a system programming language like a data structure you must know how to achieve memory safety, and might even want other properties like liveness guarantees. It's not like Rust can do this for you automatically in all, but the more trivial cases. There is unsafe Rust, and it's strictly worst than Zig as a C replacement.

On the other hand for simple API-consuming applications Rust is needlessly complicated. You throw time and money out of the window with it.

Rust's sweet spot is replacing C++.