4 ms·
I read some of the recent submissions on the issues around C undefined behavior, which sound almost nightmarish. The common impression is "C is dangerous becaus
by taliesinb 5y ago
I read some of the recent submissions on the issues around C undefined behavior, which sound almost nightmarish. The common impression is "C is dangerous because it is so powerful" -- which makes it seem like an honest tradeoff, right on the Pareto frontier between those two.
But I know think a more accurate summary would be "C was designed at a time when computer architecture had not yet consolidated, and it suffers for it, leaving you with impendence mismatch between language guarantees and hardware semantics, costing both performance and safety". It seems you need a heuristic model of compiler behavior under different optimization levels to actually achieve predictable machine behavior, really the opposite of deep control!
If we are imagining a language that could stand in the place of C and deliver on that advertised promise, I would think Zig (when stable and self-hosted), not Rust. Also, it's clear to anyone following Zig that it is just plain fun! The language reference is quite entertaining, for example. And Zig Showtime is a great YT channel.