4 ms·
Your comparisons to other languages are pretty misguided. In particular, virtually everyone who prefers haskell over ocaml also prefers C over ada or pascal, m
by asdasf 13y ago
Your comparisons to other languages are pretty misguided. In particular, virtually everyone who prefers haskell over ocaml also prefers C over ada or pascal, making it contradictory. Ocaml isn't more pragmatic than haskell.
- beagle3 13y agoIt's an "or", not "and necessarily". People I know that prefer J (or APL) to K, tend to prefer Haskell to OCaml, _and_ / _or_ Ada to C _and_ / _or_ VHDL to Verilog. YMMV. Ocaml is more pragmatic than Haskell, in my opinion: Eagerness is more practical than laziness (if less elegant and less theoretically beautiful), refs more practical than e.g. state monads. I'm not fluent in either, so correct me if I'm wrong, but my impression is that OCaml is in most senses an impure superset of Haskell (there is always a relatively simple, though rarely trivial, translation from Haskell to OCaml, but the other way around does not exist if you use any state). http://jxyzabc.blogspot.com/2009/03/haskell-vs-ocaml-or-ravings-of.html http://jxyzabc.blogspot.com/2009/03/haskell-vs-ocaml-or-ravi... echoes my impression. The discussion is, of course subjective - given a way to do IO and turing completeness, all languages are in many senses equally practical.
- asdasf 13y ago>It's an "or", not "and necessarily". Yeah, but what I am saying is that you put the same people on both sides. Virtually everyone in haskell land is a C fan, it was a recent topic of discussion actually. >Ocaml is more pragmatic than Haskell, in my opinion There's a reason the haskell community is far larger than the ocaml community, and that the tools and libraries for haskell are way ahead of those for ocaml. From a purely pragmatic perspective, haskell is a far more useful language than ocaml. I say this as someone who switched from ocaml to haskell for entirely practical reasons. >Eagerness is more practical than laziness No it isn't. In 95% of cases it isn't relevant. In the other 5%, you want to use the right one. For practical purposes, it does not matter if a language is lazy by default or strict by default, as long as it is easy to do the other one. Ocaml makes it easy to do lazy, haskell makes it easy to do strict. >refs more practical than e.g. state monads Refs are not comparable to state monads. They are comparable to IORefs, or MVars, or TVars. Which are more useful than ocamls refs. A state monad is an extra thing ocaml simply lacks altogether. >so correct me if I'm wrong, but my impression is that OCaml is in most senses an impure superset of Haskell Not at all. Ocaml and haskell share a similar subset, but both have large area the other doesn't. There is very rarely a simple translation from haskell to ocaml, as ocaml is missing so many things that are commonly used in haskell code. There is more often a simple translation from ocaml to haskell, as idiomatic ocaml rarely uses objects. First class modules is generally the issue with translating in that direction. >http://jxyzabc.blogspot.com/2009/03/haskell-vs-ocaml-or-ravi.. http://jxyzabc.blogspot.com/2009/03/haskell-vs-ocaml-or-ravi.... echoes my impression. Yes, and it repeats the same weird memes about haskell that don't actually make any sense to someone who has used haskell for a non-trivial project. Like "needing monads for state".
- beagle3 13y agoOk then, I stand corrected. What would you recommend as a good Haskell text for someone who's gone through learn you a Haskell (and countless other tutorials, which all seem to be fixated on Monads and do a bad job at it)? And, which non trivial but not too big project would you recommend I study to get an idea of good pragmatic Haskell practices?
- asdasf 13y agoI probably can't help you much there, I think LYAH is pretty good. Are you trying to avoid learning monads, or you want a different approach to learning them? I think this is the best explanation of monads: http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html http://blog.sigfpe.com/2006/08/you-could-have-invented-monad... GHC itself is a good example project to look at, the base libraries tend to all be pretty idiomatic. Xmonad is a good option too.