this post was submitted on 01 Sep 2025
125 points (97.0% liked)

Programming

22516 readers
160 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
top 26 comments
sorted by: hot top controversial new old
[–] vga@sopuli.xyz 15 points 4 days ago* (last edited 4 days ago)

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.

[–] beeng@discuss.tchncs.de 8 points 3 days ago (1 children)

What was said on nixos? Tldw

[–] rozodru@piefed.social 26 points 3 days ago (1 children)

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.

[–] TehPers@beehaw.org 7 points 3 days ago

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.

[–] SpaceNoodle@lemmy.world 12 points 4 days ago* (last edited 4 days ago) (5 children)

I wonder how the Rustaceans will react to his honest criticism.

Edit: exactly how I expected, LOL

[–] ExLisper@lemmy.curiana.net 58 points 4 days ago

‘”I have written only one Rust program, so you should take all of this with a giant grain of salt,”

I will listen to his sound advice and not take it very seriously.

[–] iglou@programming.dev 2 points 2 days ago

You call that a criticism? It's a first impression.

[–] TheTechnician27@lemmy.world 40 points 4 days ago* (last edited 4 days ago) (5 children)

I don't know how else they could react:

And the compiler was slow, the code that came out was slow…

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.

The support mechanism that went with it — this notion of crates and barrels and things like that — was just incomprehensibly big and slow.

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.

I have written only one Rust program, so you should take all of this with a giant grain of salt,” he said. “And I found it a — pain… I just couldn’t grok the mechanisms that were required to do memory safety, in a program where memory wasn’t even an issue!

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:

  • I agree the compiler is slower. Honestly boo hoo. It's slower for two very good reasons (better static analysis and better feedback).
  • The code being slower is such a minor issue as to effectively not be true. Benchmarks prove this.
  • I'm not going to take "big and slow" as a serious critique of Cargo from someone who idealizes C's ridiculous, tedious, convoluted build system.
  • The borrow checker is trivial, and unlike C, the compiler actually gives you easy, intuitive feedback for why your code doesn't build.
[–] _thebrain_@sh.itjust.works 16 points 4 days ago (2 children)

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.

[–] mitchty@lemmy.sdf.org 16 points 4 days ago (2 children)

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.

[–] FizzyOrange@programming.dev 4 points 4 days ago (1 children)

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.

[–] nrab@sh.itjust.works 4 points 3 days ago (1 children)

Gcc, clang, msvc, and all the other compilers also don’t optimize by default. It’s very normal and very expected for the default build to not include optimizations

[–] FizzyOrange@programming.dev 0 points 2 days ago

Sure but you don't normally run GCC or Clang directly; you make, and that normally does optimise. I think a closer example is CMake which doesn't enable release mode by default.

MSVC is usually run from Visual Studio which makes it obvious which mode is being used so the default doesn't matter so much.

As for "all the other compilers", Go optimises by default. It does seem to be the exception though...

[–] gravitas_deficiency@sh.itjust.works 0 points 4 days ago* (last edited 4 days ago)

Yeah honestly this does smack of PEBKAC/RTFM

[–] Ephera@lemmy.ml 6 points 4 days ago

Yeah, cargo build produces a debug build and cargo build --release is for actually distributing to users. (It doesn't add the debug symbols, but also spends more time optimizing.)

[–] Ephera@lemmy.ml 11 points 4 days ago

The support mechanism that went with it — this notion of crates and barrels and things like that — was just incomprehensibly big and slow.

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.

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, because cargo isn't much harder to use.

[–] unique_hemp@discuss.tchncs.de 7 points 4 days ago

Off the top of my head the compiler is slow because:

  1. With C you can compile every file in parallel, in Rust compilation of a single crate is serial (hence splitting up large projects into many crates is important, but that makes development somewhat more difficult)
  2. LLVM itself is pretty slow
  3. Generic functions are monomorphized (there's a unique machine code version of it for every concrete type combination they are called with) to improve runtime performance, but that gives LLVM a lot more work to do - see point 2
[–] FizzyOrange@programming.dev 6 points 4 days ago

It’s slower for two very good reasons (better static analysis and better feedback).

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.

[–] tracyspcy@lemmy.ml 5 points 4 days ago

No language guarantees high-speed code. Rust, like C and C++, is also perfectly suited for writing slow code

[–] Solemarc@lemmy.world 17 points 4 days ago (1 children)

What honest criticisms did you find in this article? All I saw was;

  • compiling is slow
  • borrow checker is complicated

This isn't new?

[–] floofloof@lemmy.ca 17 points 4 days ago* (last edited 4 days ago) (2 children)

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.

[–] TheTechnician27@lemmy.world 19 points 4 days ago* (last edited 4 days ago) (1 children)

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++.

[–] tetrislife@leminal.space -3 points 4 days ago

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.

[–] Ephera@lemmy.ml 7 points 4 days ago* (last edited 4 days ago)

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).

[–] ISO@lemmy.zip 3 points 4 days ago* (last edited 4 days ago)

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 to cargo 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.

[–] thingsiplay@beehaw.org 4 points 4 days ago

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.