Hacker News new | ask | show | jobs
by nmilo 86 days ago
I will never stop hating on the orphan rule, a perfect summary of what’s behind a lot of rust decisions. Purism and perfectionism at the cost of making a useful language, no better way to torpedo your ecosystem and make adding dependencies really annoying for no reason. Like not even a —dangerously-disable-the-orphan-rule, just no concessions here.
4 comments

I think there are legitimate criticisms of Rust that fall in this category, but the orphan rule ain’t it.

In most other languages, it is simply not possible to “add” an interface to a class you don’t own. Rust let’s you do that if you own either the type or or the interface. That’s strictly more permissive than the competition.

The reasons those other languages have for not letting you add your interface to foreign types, or extend them with new members, are exactly the same reasons that Rust has the orphan rule.

It's not a restriction born out of purity, notably uncompromising Haskell allows orphan instances.
Good for better, better for us. Rust is choke full of hard compromises and reactionary subcultures. Just recalling ? alone.
Go: error handling stinks. Generics would be dope.

Rust: if you spent 3 weeks understanding the syntax and borrow-checker, here are all of the other problems, and the list keeps growing.

Man this cracks me up.