4 ms·
Technically, the language is excellent. Organizationally, major corporations have invested a lot of resources into it, they won't allow it to fail. Community-wi
by Georgelemental 3y ago
Technically, the language is excellent. Organizationally, major corporations have invested a lot of resources into it, they won't allow it to fail. Community-wise, there are lots of friendly and supportive people in the quieter corners (this is true most everywhere, I think).
That being said, my recommendation for learning systems programming would be to consider trying plain old C first. Rust's safety features are a godsend, but IMO easier to understand once you have experienced working without them. (Similarly, I like to recommend leaning a dynamically typed language first, and introducing static typing later.)
- eek2121 3y agoI definitely have to agree with this. C was both easy and hard. Easy because the syntax and stdlib were both simple. Hard because you had to learn pointers/memory management. Also, side note: C != C++.
- MuffinFlavored 3y ago> Easy because the syntax and stdlib were both simple. the stdlib could have like ~5 ease of life things (linked list, hashmap come to mind) that would have made a world of difference in my opinion
- keyle 3y ago+1 for C before Rust. It will help you appreciate the logic behind the borrow checker much easier. Also once you learn C, you never lose C. C will still be around, and it's good knowledge, it's not wasted knowledge. C doesn't really change anymore. You can take it to the grave. C forces you to have a good understanding of what the hardware does compared to high level languages, but without the assembly grind.
- MuffinFlavored 3y ago> Rust's safety features are a godsend, but IMO easier to understand once you have experienced working without them. Passing around a pointer becomes passing around a borrow or a Mutex<T> or Arc<Mutex<T>>. Not sure how you'd summarize Rc<T> or Box<T>
- rice7th 3y agoWell, it depends on what you define by passing a pointer. Is the pointer mutable (needs to modify the data it is pointing at?) or immutable? Is it a reference ("guaranteed" pointer?) Or just a plain old pointer? (const T and mut T)? Or do you want a smart pointer, like Box<T> or a unique_ptr-ish thing with a reference counted pointer via Rc<T>? Want to pass and modify data from and to multiple threads? Yea just drop an Arc<Mutex<T>> and you're good to go. If you just want to pass some data, even around threads, without modifying it, then a plain old borrow is your best bet. Make sure to get the lifetimes right tho!
- Olreich 3y agoRc<T> is a chunk of memory you can only access through special versions of malloc and free. These don’t actually allocate new memory with the OS though, they just give you pointers to the memory and tell the memory management system that you’re done using it. Once everyone who has allocated that memory calls free, then the memory is actually given back to the OS. Box<T> is the same, except if you have multiple people try to call the special malloc it will fail to compile.