2 ms·
> The OCaml compiler, great as it is, won't turn linked list source code into array machine code. Why not? If the compiler can see that you have a short-lived
by lmm 2y ago
> The OCaml compiler, great as it is, won't turn linked list source code into array machine code.
Why not? If the compiler can see that you have a short-lived local linked list and are using it in a way for which an array would be faster, why would it not do the same thing that an array would do?
- derdi 2y ago> Why not? Because it doesn't. Doesn't mean it couldn't, if it tried hard enough. But it doesn't, as a statement of current fact.