7 ms·
Can you explain how? Obviously at least two people either disagree or aren't privy to the knowledge you hold!
by codygman 12y ago
Can you explain how? Obviously at least two people either disagree or aren't privy to the knowledge you hold!
- peteretep 12y agoI suspect a reasonable person might expect you to explain how you came to the conclusion that a language with a smaller or comparative user base / popularity to Haskell "popularised" type classes.
- sanderjd 12y agoHuh, I interpreted it differently, as in questioning whether Go's interfaces have much in common with Haskell's typeclasses. But now I'm intrigued — does Haskell really have a larger or comparative popularity as Go? That would surprise me, but I don't have any data, do you?
- peteretep 12y agoIt's remarkably difficult to find anything approaching hard numbers :-) However, I am going off: * http://redmonk.com/sogrady/2015/01/14/language-rankings-1-15/ http://redmonk.com/sogrady/2015/01/14/language-rankings-1-15... (Haskell slightly ahead in their numeric ranking) * http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html http://www.tiobe.com/index.php/content/paperinfo/tpci/index.... (Golang slightly ahead in their ranking) * Slightly more published books on Haskell that I can find (although obviously it's been around a lot longer) I have no doubt that Go will eventually surpass Haskell in terms of popularity, and may even have a slight edge, but suggesting that Go popularized typeclasses smacks of fanboyism, and reminds me - in no small measure - of: https://www.youtube.com/watch?v=bzkRVzciAZg https://www.youtube.com/watch?v=bzkRVzciAZg
- codygman 12y ago> suggesting that Go popularized typeclasses smacks of fanboyism I'm not exactly a fan of Go nor am I a fanboy, quite the opposite these days. I don't have to like go to mention that the way interfaces are used kind of accomplish the same thing as typeclasses. I also feel that (sadly) Go is more popular than Haskell. Partially because of the number of Haskell programmers I've encountered in real life is much lower than the number of Go programmers I've encountered.
- hyperpape 12y agoWhy do you think they're similar? Is it actually specific enough that it couldn't apply to Pythonic duck typing, or Java interfaces?
- bkirwi 12y agoThere's a bit of writing on StackOverflow about it: http://stackoverflow.com/questions/2982012/haskells-typeclasses-and-gos-interfaces http://stackoverflow.com/questions/2982012/haskells-typeclas... The main similarity is that 'methods' are defined 'outside' the data type they belong to. But there are a huge number of differences: Haskell's typeclasses are used for many things that don't look like methods at all, while Go's behave more like a classic OOP interface you'd find in Java. So, perhaps superficially similar-looking, but they work quite differently in practice.