← Back to context

Comment by classified

7 years ago

I regularly read the assembly output of the OCaml compiler I'm using and there are very few surprises. The mapping from source to generated assembly is quite straightforward. You couldn't say the same for Haskell, though. So it depends on which FP language you're using.

Does OCaml give you enough tools to optimize around things like CPU-cache and memory management costs? It's one thing to know what kind of assembly is going to be produced by a block of code, but it's another thing to be able to get the machine to do exactly what you want.

I absolutely can say that about Haskell. You have to actually learn the language, but it doesn't do anything unpredictable.

Actually I’ve found it pretty easy to track / reason about. But I guess I do have a decent mental model for how the compiler works