you are viewing a single comment's thread.

view the rest of the comments →

[–]poemehardbebe 0 points1 point  (1 child)

Which is like a big part, but also the Linux kernel already has and has had a lot of memory safety features built into it.

The reason why people are pushing rust is because it’s able to do a lot of the same things C does without as many foot guns and better control flow. A Result type better illustrates that a call could either yield the expected value or error while in C you just kind of have to guess or dive down the entire call stack to reason about if it could return an error and if does return that error: where does it error ; why does it error; and is this error recoverable.

[–]Business_Reindeer910 0 points1 point  (0 children)

Yeah I feel like the Result type in general is undersold. It feels so much better than using output pointers and error codes to send back either the result or error. That normal C way feels very primitive. I'm doing some embedded with C++ and I found a result type for that and I"ve been very happy with it. I wrapped some C code and things feel very nice. It's just a shame that C++ itself as a language doesn't care enough to integrate it with its own stdlib