4 ms·
OCaml has most of the "good and easy parts" of Haskell, without the ones that prevent you from using your old habits: * no lazy evaluation => your usual sense
by fab13n 11y ago
OCaml has most of the "good and easy parts" of Haskell, without the ones that prevent you from using your old habits:
* no lazy evaluation => your usual sense of what's executed when isn't challenged
* imperative features included, albeit often syntactically ugly => You're not stuck because you need to compose 3 monad transformers together, you can't make sense out of the resulting types, and you have absolutely no idea of how the result might be executed anymore. Empirically, the imperative syntax is just ugly enough to make you slightly ashamed of going imperative, and spend 1/4 hour figuring out whether there's a clean and reasonably easy alternative. I don't known whether it's been done on purpose but it's well done :-)
What I miss the most from Haskell in OCaml are type classes. I bet they would have been included, if OCaml had been invented after Haskell.
From Haskell you keep a type system which helps you thinking and finds many error classes, encouragement to think functionally, godd terseness/readability compromise. If you have the time, I'd advise you to learn Haskell, in order to stretch your mind and become an excellent OCaml developer, the way learning Latin makes you a better French or Italian writer.
Re: lack of tooling: I'd be surprised if F wasn't properly supported, and if you're targeting Windows that's probably your best bet. More fundamentally, your truly valuable tooling isn't the IDE, it's the type system. I need a fancy IDE for Python or Java, not for OCaml.
- tel 11y agoTypeclasses play poorly with Modules. One is the picture of a global phenomenon and the other the essence of forsaking global phenomena. There's current work under the name "modular implicits" to solve this problem, though.
- arto 11y agoFor those interested in modular implicits, see http://www.lpw25.net/ml2014.pdf http://www.lpw25.net/ml2014.pdf
- thinkpad20 11y agoBut there are a few languages that have both, such as Ur and Coq, and possibly others. Also, I know that there's work on a more powerful module system for Haskell called Backpack (although, I'm not really familiar with it). I agree that there are certain conceptual incompatibilities between the two as you mention, but they're both so useful that it seems like there must be good ways to bring them together, or at least make both of them available.