4 ms·
I was interested in Rust for the strong type system and borrow checker and such as well as praise from functional programmers I trust but my experience with try
by jolux 6y ago
I was interested in Rust for the strong type system and borrow checker and such as well as praise from functional programmers I trust but my experience with trying to do FP in Rust was so dreadful that I put it down and stopped learning it. Perhaps I will need it badly enough to push through this someday.
- didibus 6y agoThe thing is Rust isn't functional, in that the coding patterns rely a lot on mutation actually, but the compiler can assert that your mutation will be race free, and that you won't segfault and most likely won't leak memory. So you can say it appeals to functional programmers in the sense that they tend to be wary of mutation, so does Rust in a way. Except where a functional language will turn to immutability, Rust turns to an advanced compiler and linear types to safeguard you against the dangers of mutation. The real benefits are performance, which has always been the achilles heel of functional programmers.
- jolux 6y agoYeah, I quickly discovered it’s not functional and has a much different perspective on mutability, despite clearly being inspired in some aspects by FP. As for performance, I don’t think it’s nearly as large a problem for FP in general as some make it out to be. OCaml and Haskell are typically quite fast, but of course they rely on GC, so they aren’t suitable for environments that are heavily resource constrained or where pauses are unacceptable.
- creese 6y agoRemember you can only have one mutable reference whereas you can have any number of immutable references. The ownership rules incentivize immutability.