4 ms·
Well. Rust is about to turn into Haskell 2.0
by choeger 8y ago
Well. Rust is about to turn into Haskell 2.0
- smt88 8y agoIs that good or bad? Sounds like it's good, but I've never used Haskell, so I don't know.
- deleted 8y ago[deleted]
- duncan-donuts 8y agoAs someone that knows only a little about Rust and Haskell, why?
- choeger 8y agoType-level programming. It basically guarantees more correctness at the cost of steeper entry barriers. In consequence you end up with (some extension of) Haskell and a probably correct implementation that no one can start to implement ;).
- AaronFriel 8y agoThe power of these is that a handful of implementations can act as enormous levers to create useful abstractions for everyone else. As an example, Rust's type system is difficult to implement and hard to prove correct - there was a problem with `std::thread::scoped`'s soundness for example - but once done, the work can be leveraged into higher (and often simpler) abstractions! Session types in Rust are exciting to me because we might see implementations of consensus algorithms leverage the type system for correctness. Everyone else then gets to benefit from a simple API on those (complicated) types.
- steveklabnik 8y agoYou don’t need that powerful of a type system to do this kind of thing; Rust is still pretty far behind Haskell in terms of raw power.
- rienbdj 8y agoIndeed. Seen similar in C++
- emn13 8y agoI don't think it's helpful to talk about "raw power" in a comparison like this; clearly there are significant type system features Haskell lacks - so this isn't a question of a simple superset. And in any case; what does raw power really mean? The two languages appear to have fairly widely different aims, and both see type-system cleverness as a boon, so it should come as little surprise that they don't all have the same tricks.
- steveklabnik 8y agoThere’s only one type system feature that Rust has that Haskell doesn’t, and Haskell will have it soon. Yet there are many features that Haskell has that Rust does not, and Rust is not getting that stuff any time soon. That’s what I mean by raw power; it is very close to a subset relationship.
- emn13 8y agoDidn't know about https://ghc.haskell.org/trac/ghc/wiki/LinearTypes https://ghc.haskell.org/trac/ghc/wiki/LinearTypes until now; I'm assuming you're referring to that? Neat!