|
|
|
|
|
by lmm
689 days 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? |
|
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.