My point is not that use-after-free or other resource allocation problems do not exist. The point is that in vanilla C any solution one might come up with is too fragile. Reasonable patterns require a very, very steady hand to work (which means it doesn't scale).
C++ came up with a few consistent language-level RAII-based solutions to the problem. Rust came up with a single big consistent language-level approach. Both Rust and C++ insist on using it in all cases.
What Zig does, and which I like, is that it refocuses the language on tools that make it easy to codify the right thing without making it a cornerstone of the language itself. But without introducing the kind of complexity C++ (and Rust to an extent) is famous for.
My point is not that use-after-free or other resource allocation problems do not exist. The point is that in vanilla C any solution one might come up with is too fragile. Reasonable patterns require a very, very steady hand to work (which means it doesn't scale).
C++ came up with a few consistent language-level RAII-based solutions to the problem. Rust came up with a single big consistent language-level approach. Both Rust and C++ insist on using it in all cases.
What Zig does, and which I like, is that it refocuses the language on tools that make it easy to codify the right thing without making it a cornerstone of the language itself. But without introducing the kind of complexity C++ (and Rust to an extent) is famous for.