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