Conversation
Edited 10 days ago

One thing I agree with Linus Torvalds about:

"Rust fixes a few easy bugs that you can make in C, but it does not fix the logic errors, right? It does not think for you, and when you write incorrect code, the language does not matter. The end result will be incorrect."

He is right, and I am a Rust programmer.

If you don't believe me, run cargo audit on any non-trivial codebase. And Rust makes it very easy to do unsound things with zero warnings in unsafe. And you actually need unsafe for many things, including many practical data structures.

2
1
0

@Elizafox it's not true as stated though. yes, obviously you can have logic bugs in any language. but some of them give you more tools to write bug-free code than others!

it's much easier to miss a logic bug when your software is implemented entirely in assembly than in c, for example, regardless of the skill of the author

0
0
0

@Elizafox

And Rust makes it very easy to do unsound things with zero warnings in unsafe. And you actually need unsafe for many things, including many practical data structures.

at the very least you only need to implement the data structure correctly once and don’t need to deal with the awkwardness of shipping library dependencies and/or keeping some vendored code up to date

2
0
2

@charlotte @Elizafox this is largely a build system thing, meson wraps + pkgconf get us most of the way to a solution but needs more time to bake

0
0
0

@charlotte @Elizafox I'll never understand why these people genuinely think reimplementing data structures every single time is a virtue. When I was working on a C codebase, we had 5 implementations of a fairly simple data structure (which is pretty low by C standards 😔). It had a bug. The fix went into 3 out of 5 copies, but 2 were forgotten about or not found.

The senior C devs could not be convinced that this is a problem. They *enjoy* this shit. Even C++ could've easily prevented this.

0
0
0