4 ms·
Well said. Though it'd be sorta neat IMO if we could use just one language here, and the memory unsafe aspect could somehow be toggled off or on, gaining all th
by notfed 2y ago
Well said. Though it'd be sorta neat IMO if we could use just one language here, and the memory unsafe aspect could somehow be toggled off or on, gaining all the pros or cons of Zig vs Rust as needed.
- lolinder 2y agoAre you thinking of something different than Rust's `unsafe`?
- cletus 2y agoWhat you're talking about here is disabling runtime assertions, which is a common practice in C/C++ (using #define macros). Runtime assertions are strictly inferior to Rust's compile-time assertions because Rust allows you to do a subset of what you can do in C/C++ but it verifies that the memory ownership is correct without a runtime cost, unsafe code notwithstanding). There simply is no way you could do that in C/C++ (and, by extension, Zig) because of the legacy support. I'm fine with having multiple languages. One language to rule them all just tends to mean something is mediocre at everything.