6 ms·
>Subtyping isn't just for the benefit of Java compatibility. What makes you think that? No objects = no subtyping. >you do need at least some sort of proof th
by papsosouid 14y ago
>Subtyping isn't just for the benefit of Java compatibility. What makes you think that?
No objects = no subtyping.
>you do need at least some sort of proof that subtyping is bad in one way or another.
Why do I need proof of something I didn't say?
>Even GHC has extensions for subtyping,
What?
>however even if you're learning it for learning's sake, it's easier to get started in Scala because of the ecosystem
The ecosystem matters the least when learning for learning sake. The complexity and difficulty of the language matter, and scala is a poor choice for that reason. You can't just learn FP with scala, you also have to learn all the hairy OO/FP integration and the ensuing problems around it.
- bad_user 14y ago> No objects = no subtyping. You are confusing OOP with subtyping. On my remark about Haskell/GHC with extensions, I'm talking about things like the Dynamic type, existential types, HList and about experiments like OOHaskell. > The ecosystem matters the least when learning for learning sake. Actually it matters the most, as good learning can only happen if you go forth and experiment on your own. That's why some languages like Python are popular, because as soon as you read a couple of chapters from a book, it's usually easy to let your imagination loose and build something. In comparison to learning math where proofs are like puzzles, in software engineering the real joy comes from building stuff.
- recursive 14y agoI get plenty of joy out of solving Project Euler problems.
- sold 14y ago> On my remark about Haskell/GHC with extensions, I'm talking about things like the Dynamic type, existential types, HList and about experiments like OOHaskell. The point of subtyping is implicit coercions: using a type T1 when T2 is expected, without extra conversion. Dynamic and existentials are not subtypes (you need fromDyn or the data constructor introducing the existential). OOHaskell is as far as I know a failed and abandoned experiment. Who uses it? I don't know HList enough to comment, but it's based on GHC's constraint system and very much unlike subtyping in Scala. I agree with you that OOP is not the same as subtyping. Here's how variance complicates stuff in Scala: http://www.reddit.com/r/haskell/comments/zxcks/haskell_vs_f_vs_scala_a_highlevel_language/c68ybn1 http://www.reddit.com/r/haskell/comments/zxcks/haskell_vs_f_... >> The ecosystem matters the least when learning for learning sake. > Actually it matters the most, as good learning can only happen if you go forth and experiment on your own. That's why some languages like Python are popular [...] No, the comparison with Python is not fair. Python is a polar opposite of Haskell. People learn Python as a scripting language. You can learn the basics of the language extremely fast. There's little didactic value in Python the language once you know imperative programming. Then real work comes by learning libraries, frameworks, APIs etc. People learn Haskell as a way to broaden horizons, see a different paradigm. GHC, with standard library only (covering a lot less than Python's batteries) gives enough material to experiment for months if not years. It takes a while to understand GADTs, type classes, kinds, higher-order types, type families etc. Learning Haskell is much closer to learning proofs/doing puzzles than software engineering. The fact that you made your program compile after two hours is rewarding like solving a puzzle. I have seen people attempting to build a concurrent web server in Haskell in first week, not knowing how laziness or class instances work and blaming Haskell for making things weird and unintuitive. The practical mindset of Python does not pay off in Haskell. So I agree with OP - the ecosystem is least concern when learning FP for learning sake.
- papsosouid 14y ago>You are confusing OOP with subtyping. No, I am not. OOP can certainly exist without subtyping, but scala has subtyping for objects. Haskell does not have subtyping. >I'm talking about things like the Dynamic type, existential types, HList None of those add subtyping. What would even be subtyped? >experiments like OOHaskell An abandoned experiment that is not a GHC extension. >Actually it matters the most You are free to think that, but nothing you said after that support that notion at all. We're talking about learning functional programming for the sake of learning functional programming. Haskell is better for that than scala is. Ecosystem is entirely irrelevant.
- nbouscal 14y ago> No objects = no subtyping. That statement is patently false.
- papsosouid 14y agoOnly if you try to interpret it out of context. The only subtyping in scala is on objects. Without objects, scala would not have subtyping.