3 ms·
> 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
by 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.)