Hacker News new | ask | show | jobs
by bsummer4 3898 days ago
I think the similarities are mostly superficial. I mean it has (local) type inference, ADTs, and traits (which are sooooorta like type classes). But, as a Haskell programmer, the Rust type system feels very foreign.

No typeclasses (and associated goodness), GADTs, HKTs, Monadic IO, first class functions, generic deriving, higher rank types, existential type, etc. These are bread-and-butter features in day-to-day Haskell work. Rust's type system isn't powerful enough to build the vast majority of the tools that Haskell programmers use every day.

I don't mean this as a criticism; The Rust design seems solid. But different priorities lead to different trade-offs, and the end result is a very different type system.

1 comments

Traits do a lot of what one can do with typeclasses (they're mostly just different names for the same thing), what differences are you thinking of?

Also, traits objects are existential types, and closures & functions are as first class as they are in Haskell (main difference is a bit more verbosity).