Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think once you gain a more than superficial understanding, you'll be happy with Rust. :)

> the shared reads of an immutable value are embarrassingly parallelizable,

This is absolutely true, and Rust lets you do that. You just have to dot your is and cross your ts: https://gist.github.com/steveklabnik/8de9b9b0ae2e45383d85 Rc adds reference counting, to ensure that this reference will be okay for the duration of all of the threads. If you just used a regular old boxed value, one of the threads could invalidate the reference.

That's just one example. As you say, there'll be libraries eventually: people have been focused on the language itself, and given how easy Cargo makes it (will make it) to share libraries, I wouldn't be surprised to see an awesome persistent/immutable data structures library appear.



Well I definitely want to play with Rust and seems really promising, even from the point of view of a superficial observer.

My impression is that reference counting, while deterministic, has some problems due to reliance on atomics (which gives rise to contention issues, even in cases in which intuitively there shouldn't be any contention) and because of cyclic references - but maybe this isn't such a problem in practice when used for persistent data-structures or if there are multiple versions of an interface suited for different scenarios.

My intuition has definitely been proven wrong before. And I have high hopes for Rust - seemingly being a language allowing for FP and for fine grained memory management while not setting my hair on fire :-)


Rust actually has two different reference counted smart pointers: `Rc`, which uses non-threadsafe reference counting, and hence is not sendable across thread boundaries; and `Arc`, which uses atomic reference counting and can be send across thread boundaries.

You can definitely create leaking cycles with both though, but Rc and Arc also support Weak pointers to safely break up cyclic ownership trees.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: