this post was submitted on 01 Sep 2025
128 points (97.1% liked)

Programming

22723 readers
279 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
you are viewing a single comment's thread
view the rest of the comments
[–] SpaceNoodle@lemmy.world 11 points 2 weeks ago* (last edited 2 weeks ago) (20 children)

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

Edit: exactly how I expected, LOL

[–] TheTechnician27@lemmy.world 40 points 2 weeks ago* (last edited 2 weeks ago) (11 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 2 weeks 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 2 weeks 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 2 weeks 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 2 weeks 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 1 points 2 weeks 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 2 weeks ago* (last edited 2 weeks ago)

Yeah honestly this does smack of PEBKAC/RTFM

[–] Ephera@lemmy.ml 6 points 2 weeks 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.)

load more comments (8 replies)
load more comments (16 replies)