Unix Co-Creator Brian Kernighan on Rust, Distros and NixOS
(thenewstack.io)
from who@feddit.org to programming@programming.dev on 01 Sep 19:16
https://feddit.org/post/18221137
from who@feddit.org to programming@programming.dev on 01 Sep 19:16
https://feddit.org/post/18221137
#programming
threaded - newest
I wonder how the Rustaceans will react to his honest criticism.
Edit: exactly how I expected, LOL
I will listen to his sound advice and not take it very seriously.
What honest criticisms did you find in this article? All I saw was;
This isn’t new?
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++.
By the vague looks of it, he has tried Rust for something he would use C for. His impression of Rust’s utility in that domain seems unsurprising.
Beyond that
I used to not question why we build anything other than “system software” in C/C++. Once I questioned that, I quickly got past the “Why not Ada/D/etc.” stage and reached the “why is so much of large software written in mid-level languages” stage. For anything bigger than, say, a Unix CLI tool, it probably is, and has always been, wrong to use anything at the level of C (C++, Ada, D, Nim, Rust, Zig, etc.).
This choice of language level for “application software” seems to be a commercial choice. The software commons is using such languages probably because contributors want to hone their job-oriented skills. It got better with Python and Ruby uptake in open projects. But, efficient, safe but simple languages, say, OCaml and Erlang, have been available for decades. Crystal is also looking good right now.
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).I don’t know how else they could react:
The compiler is slower because it has more to check for, but “the code that came out was slow” seems like nonsense, exaggeration, or PEBCAK. Rust code is highly performant and very close to C code.
Dude what? C’s build systems like cmake are notoriously unfriendly to users. Crates make building trivial compared to the ridiculous hoops needed for C.
He doesn’t say what the program was, and the borrow checker operates by a set of just a few extremely simple rules. There’s no idea of what he was trying to accomplish or how the borrow checker impeded that.
So my reaction as someone who cares deeply about how disastrously unsafe C is and the tangible havoc it creates in modern society:
No language guarantees high-speed code. Rust, like C and C++, is also perfectly suited for writing slow code
In my limited experience the speed a rust complied executable runs is highly dependent on compiler options. By default (from what I remember), rust includes a ton of debug info in the resulting program. With the correct compiler flags you can strip all that out and programs run very close to c speeds.
The default for cargo is debug builds why that would surprise anyone as being slower is beyond me, —release isn’t that much extra to type or alias. Do people not learn how their tools work any longer? This isn’t that far off from c/c++ where you set cflags etc to fit the final binaries purpose.
Yeah honestly this does smack of PEBKAC/RTFM
Tbf this mistake comes up so often I do wonder if cargo should have defaulted to release builds. It seems to be what beginners expect.
Yeah,
cargo build
produces a debug build andcargo build --release
is for actually distributing to users. (It doesn’t add the debug symbols, but also spends more time optimizing.)I wouldn’t be surprised, if the guy does not normally use a build system to begin with. Professors don’t tend to have the time to write software that would require a build system (both in terms of complexity and being used by end users).
So, I’m guessing, all he wanted was
rustc
, but most Rust tutorials don’t bother explaining it, becausecargo
isn’t much harder to use.Apparently that’s not really the reason.
cargo check
is usually quite fast.I also wouldn’t say Rust code is slower than C. It wins in some places (e.g. strict aliasing) and loses in others (e.g. bounds checks) but in practice it’s usually much faster because it’s so much easier to use fast containers (not just linked lists everywhere), fast libraries, and multithreading.
Off the top of my head the compiler is slow because:
People stopped taking Brian seriously when he helped create Go. That was pre-Rust.
Even the “talking points” here seem to be re-used from “Go vs. X” ones. Also, his experience speaks of someone who only tried Rust pre-v1.0.
Anyone who actually knows Rust, anti- or pro-, knows that what he said (partially in jest) is factually wrong.
Feel free to prove otherwise, especially the part about the performance of Rust programs. Don’t be surprised if he simply didn’t pass
–release
tocargo build
, a common pitfall for someone in the “hello world” stage of trying Rust.And this is why appeal to authority was never more fallacious, considering we live in a world where Dunning-Kruger is a universal reality.
I just rewatched an interview with Kernighan / on SkipVideos that is 5 years old. Back then he was experimenting with Rust a bit and wanted to go back. I’ll watch this new presentation or interview at UNIX: A History and a Memoir by Brian Kernighan / on SkipVideos later, so cannot comment here about the content at the moment.
And wow, I did not notice he was already 83 years young! And still teaching. Imagine your teaching being B. Kernighan.
The way this article was written was weirdly sycophantic. It’s like the meme where “everybody stood up and applauded” but in this case it happened every 5 minutes.
Well, I hope anyone will care what I think when I’m 83.
What was said on nixos? Tldw
he said he never heard of Nix or NixOS. that's it. it's a dumb article that just poorly sums up a few youtube videos of his talk.
This. It’s just like “this dude is cool” and some fun Q&A and circlejerking, which is fine, but he probably should not be used as a credible source for understanding younger stuff.