Hacker News new | past | comments | ask | show | jobs | submit login

All that instead of type classes eh?



Indeed. Pains me to see what they are doing while not learning from existing and well established language patterns.

I understand that Go wants (or wanted) to stay "simple" but now it seems to become the worst of two worlds: it's neither simple anymore but also doesn't benefit from high level language features like typeclasses because it's too late to add them now.


It's more similar to semantic subtyping as a set interpretation of some types. That avoids having different constructs for similar things.

Personally I find this elegant.


Go has type classes, they're called interfaces


Not the same, because with an interface, the methods defined for the struct must match the interface.

With type classes you can bridge that gap because the implementation of the struct for a specific type class can be defined anywhere.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: