Memory Safety Absolutists

44 points by ekuber


doug-moen

Here is a quote by Andrew Kelly that the OP apparently found offensive:

Zig can offer its users an option to compile their projects, including entire tree of C/C++ dependencies, into an executable that is fully memory safe, with no escape hatch, at a ~1-6x performance penalty (depending on prevalence of pointer chasing).

Once this is implemented then, in a twist of fate, Zig will become one of the only toolchains capable of producing actually memory safe executables, especially when you consider that real world applications tend to have C/C++ dependencies and, in the case of Rust, additional use of unsafe beyond FFI.

The author seems to be treating this as an attack against Rust, and closes the article with an attack against Zig.

My own reaction is that Fil-C and the new Zig build mode are positive contributions to the ecosystem. Andrew's point about this build mode generating fully memory safe executables is a useful and valid point. The comparison to Rust is technically relevant. This new Zig build mode legitimately exists at a different point in the design space than Rust, and makes different tradeoffs. That is worth knowing about.

Andrew's parenthetical remark is also worth noting: “at a ~1-6x performance penalty (depending on prevalence of pointer chasing)”. I interpret this to mean that if you use the data-oriented programming style preferred by the Zig core team, then the performance penalty can be brought closer to 1×.