3 ms·
That's not an answer though. I believe (but I know little of both Haskell and Rust) that Haskell polymorphism is at least as powerful as rust static polymorphis
by gpderetta 6y ago
That's not an answer though. I believe (but I know little of both Haskell and Rust) that Haskell polymorphism is at least as powerful as rust static polymorphism but it is normally implemented via type erasure.
I think the real reason is that rust gives additional guarantees about lack of allocation and object layout that are hard to implement with dictionary passing (BitC tried and failed).
- Tyr42 6y agoI agree somewhat, in Haskell you can write generic functions without traits, and I think they are not monomorphized. (map for example.) However, I think these all operate on boxed objects, which is a little bit easier to do than for Rust, where only some objects are boxed. In short, I agree.