4 ms·
> C programmers tend to write their data structures themselves. Rust programmers tend to use packages. If you've determined that you need a linked list in Rust,
by xfer 8y ago
> C programmers tend to write their data structures themselves. Rust programmers tend to use packages. If you've determined that you need a linked list in Rust, you don't start writing one: you "use std::collections::LinkedList;". It's a doubly-linked one, so maybe that's not what you need. In that case, you go on crates.io and see if someone has already written what you need. (225 hits incidentally: https://crates.io/search?q=linked%20list https://crates.io/search?q=linked%20list)
Not sure why you bring this up, since sooner/later people are going to need to implement their own data-structures(and this ownership problem will surface) and being it harder to implement is not relevant to package management(after all somebody did just implement that and made it available).
- djur 8y agoIt's very relevant in the context of whether Rust is a 'get things done' language. Implementing a linked list is not a characteristic task of 'getting things done' in Rust, just like implementing a hash table isn't a characteristic task of 'getting things done' in Python. And when you do need to do it, implementing a data structure isn't any harder in unsafe Rust than in C++.