Hacker News new | ask | show | jobs
by hajile 2070 days ago
Ocaml's optimization is very good, but not perfect. For example, if you need 32-bit integers instead of 31-bit integers, your performance is going to tank due to boxing.

MLton is a whole program optimizer (rather than function at a time like Ocaml) and wrings out a ton of performance though compile times are quite a bit longer.

1 comments

I believe flambda is whole program, could be wrong tho
https://www.cs.cornell.edu/courses/cs3110/2017fa/htmlman/fla...

As of 3 years ago it wasn't, but maybe that has changed.

Whole program compilation isn't without its downsides though. It seems pretty common to develop in SML/nj because of fast compiling then doing final performance profiling and deploying with mlton (having a standard helps). Function at a time is also more amenable to caching and reusing part of the previous compile.