Kernighan shared his thoughts on what he thinks of the world today — with its push away from C to more memory-safe programming languages, its hundreds of distributions of Linux — and with descendants of Unix powering nearly every cellphone.
He said the code that came out was slow, but Rust always ranks within the top handful of languages for speed, so I’m taking that comment with a big pinch of salt. Among popular systems languages only C and C++ really beat Rust for speed. So you get better memory safety for the price of a pretty small decrease in speed and a steeper learning curve for the compiler’s picky rules (though the compiler gives you lots of clear help). Rust programmers know this.
I’d go even further: the learning curve for Rust is shallower than C/C++.
C is obvious: dealing with strings is a goddamn nightmare in pure C, and strings are used all the time in modern programming. Almost no guardrails for memory safety mean that an inexperienced programmer can easily run into undefined, nondeterministic behavior that makes bug hunting difficult.
In C++, there’s a trillion ways to do anything (which varies enormously based on C++ version), and when you make mistakes of even moderate complexity (not “missing semicolon on line 174”), compilers like gcc spit out a gargantuan wall of errors that you need to know how to parse through.
Rust, in my experience, gives you a much clearer “good” way to do something with some room for expression, and its compiler tells you exactly what you did wrong and even how to resolve it.
The fact that the compiler actually guides you, to me, made learning it much easier than C/C++.
My guess is that he was using cargo build rather than cargo build --release. Relatively common for folks to complain about due to that, because beginner tutorials tend to skip that info (which is fair IMHO).
He said the code that came out was slow, but Rust always ranks within the top handful of languages for speed, so I’m taking that comment with a big pinch of salt. Among popular systems languages only C and C++ really beat Rust for speed. So you get better memory safety for the price of a pretty small decrease in speed and a steeper learning curve for the compiler’s picky rules (though the compiler gives you lots of clear help). Rust programmers know this.
I’d go even further: the learning curve for Rust is shallower than C/C++.
The fact that the compiler actually guides you, to me, made learning it much easier than C/C++.
My guess is that he was using
cargo build
rather thancargo build --release
. Relatively common for folks to complain about due to that, because beginner tutorials tend to skip that info (which is fair IMHO).