1. I can definitely see its future in drivers, filesystems, codecs (areas where both performance and correctness is required).
2.
+ Rust has fantastic error handling. No null pointers. Mandatory error checking, but with very light syntax.
+ Dependencies and modularization in Rust are soooo much easier than in C.
+ You never have to write `free()` again.
+ Thread-safety can be guaranteed at compile time.
- Significant learning curve. You need to "get" Rust's ownership approach before you even manage to compile a non-trivial program.
- It's still "new", so it may be hard to convince people to use it. C is 45 years old, so it seems like a safe bet (it has flaws, but the flaws are well-known).
3. What Rust calls "unsafe" is what all of C is, so it's never worse than C. The idea is that you carefully implement these structures using raw ("unsafe") pointers, and wrap them in a safe Rust API. This way you need get it right once, and rest of the code doesn't have to worry about breaking things.
> You need to "get" Rust's ownership approach before you even manage to compile a non-trivial program.
I'm not entirely certain that's true. I wrote a useful (to me) cli script and only have the vaguest understanding of how the ownership model works. I think for text processing sorts of tasks, it's not too difficult to use.
As someone learning rust and currently going through this, I would consider that a trivial program. You will know once you get there because you hit kind of a wall where you have to learn and understand what is basically a language inside of a language. And the language is kind of this mapping for logic that only used to be inside of your head (ownership logic), and so translating that fluently into this brand new language is a real roadblock.
The ownership model isn't too bad for strings, but those are easily the most simple way to start using the ownership model. At least for me, getting into the more advanced ownership stuff is a whole different beast entirely.
1. I can definitely see its future in drivers, filesystems, codecs (areas where both performance and correctness is required).
2.
+ Rust has fantastic error handling. No null pointers. Mandatory error checking, but with very light syntax.
+ Dependencies and modularization in Rust are soooo much easier than in C.
+ You never have to write `free()` again.
+ Thread-safety can be guaranteed at compile time.
- Significant learning curve. You need to "get" Rust's ownership approach before you even manage to compile a non-trivial program.
- It's still "new", so it may be hard to convince people to use it. C is 45 years old, so it seems like a safe bet (it has flaws, but the flaws are well-known).
3. What Rust calls "unsafe" is what all of C is, so it's never worse than C. The idea is that you carefully implement these structures using raw ("unsafe") pointers, and wrap them in a safe Rust API. This way you need get it right once, and rest of the code doesn't have to worry about breaking things.