←back to thread

205 points michidk | 2 comments | | HN request time: 0.524s | source
Show context
baq ◴[] No.41835199[source]
As expected, the people problem is the biggest factor. Turns out getting C folks to learn Rust is a difficult proposition (hello, lkml) but the other way around it isn't too much of a problem.

I wonder how much of it is low-level experienced developers only ever using C fail to see that C is not the universally best tool (or, 'if all you have is a hammer, everything looks like a nail' question).

replies(5): >>41835262 #>>41835561 #>>41835870 #>>41836074 #>>41836108 #
fulafel ◴[] No.41835561[source]
The complexity of Rust is on another level, it's a huge language.
replies(1): >>41836290 #
baq ◴[] No.41836290[source]
It’s a tradeoff. The ownership rules are mostly the same as C. The difference is that Rust enforces them at compile time.
replies(1): >>41836710 #
fulafel ◴[] No.41836710[source]
Hrm. These are the top level Rust ownership rules according to the book[1]:

    Each value in Rust has an owner.
    There can only be one owner at a time.
    When the owner goes out of scope, the value will be dropped.
C has none of these. Or borrowing, etc.

[1] https://doc.rust-lang.org/book/ch04-01-what-is-ownership.htm...

replies(3): >>41837086 #>>41839074 #>>41839855 #
1. baq ◴[] No.41837086[source]
To get robust software out of C you don't have many options other than to adopt these rules. You can have useful software which breaks all of these, but you don't want to maintain it.
replies(1): >>41839222 #
2. throwawaymaths ◴[] No.41839222[source]
Robustness is relative. You can certainly write a cli that does everything in an arena; your GC is the OS and so going out of scope -- who cares. doing nothing and eliminating whole classes of errors from consideration (UAF e.g.) is incredibly maintainable.

Or, as the old tale goes, your GC might be the software literally exploding (it's in an air to air missile)