3 ms·
I find it very interesting that you put Haskell in one camp, and OCaml into the other. I am more of a Standard ML guy instead of OCaml, but can you elaborate a
by auggierose 6y ago
I find it very interesting that you put Haskell in one camp, and OCaml into the other. I am more of a Standard ML guy instead of OCaml, but can you elaborate a bit why you feel you can iterate faster in OCaml than in Haskell?
- eru 6y agoOCaml is quite a lot more pragmatic and 'loose' than Haskell. But that's just my impression. They even have for-loops in OCaml.. (I would be really slow writing code in vanilla JavaScript. There's no static checking, and not much dynamic checking. So you need to watch your step very carefully---in some sense, very much like in C++.)
- pdimitar 6y ago> OCaml is quite a lot more pragmatic and 'loose' than Haskell. But that's just my impression. Mine too. I still dislike the lack of Unicode strings by default, and the somewhat confusing tooling (initially) but outside of that I quite love the language. It has a huge potential and I can only hope that the arrival of Multicore to the upstream language will kick it forward and put it in the same league as Rust (although due to GC it can never be that fast I'd think; but who knows).
- eru 6y ago> (although due to GC it can never be that fast I'd think; but who knows). Well, in theory GC can be made very fast. Though you sort-of have to decide whether you want maximal throughput or real-time latency guarantees. In practice, we aren't quite there yet, alas. The way to get really fast code is just to avoid allocation, I'd guess? OCaml allows you to use mutation, and it's relatively easy to peak under the hood to see what your code gets translated into. The main technical innovation of Rust is the borrow-checker. But that piece is very related to linear types / uniqueness types. There's some interesting work going on with linear types in Haskell. And just like Generalized Algebraic Data Types also eventually made their way to OCaml, there's no fundamental reason they couldn't add linear types to OCaml, I guess? (Linear types can basically be used to encode the FP equivalent of manual memory management.)
- pdimitar 6y agoCheck my reply in another comment that's sibling to yours.