2 ms·
The ocaml compiler does constant folding too, and I consistently look at the (usually javascript because of Bucklescript) output in amazement when it finds shit
by pkilgore 7y ago
The ocaml compiler does constant folding too, and I consistently look at the (usually javascript because of Bucklescript) output in amazement when it finds shit like that. Unrolling all my tail recursion is great too.
- pjmlp 7y agoFor anyone that wants to learn about optimizations in AOT compiled ML languages, have a look at: "The Implementation of Functional Programming Languages" "Compiling with Continuations" "Modern Compiler Implementation in ..." (C, Java and ML variants) Although oriented towards Lisp, "Lisp in small pieces" is a classical book as well, with many optimizations like inlining of lambda calls across multiple call levels.