Today, we are excited to share with you a first glance at some redactional work
that has been brewing behind at the scenes at OCamlPro for quite a some time
now!
We are starting a series of blogposts on the Flambda2 project. The goals are
plenty, one of them being to give all readers an idea of the inner workings of
this great piece of software, 10 years of research & development in the making.
The first two episodes are rather special to the series:
Episode 0 gives context and broader information on both the Flambda2 Optimising Compiler project, and the series of blogposts itself.
Episode 1, on the other hand, steps right into the subject at hand and covers some of the foundational design decisions of this compiler.
We await your feedback below, and hope that you will enjoy reading these posts, and all ensuing ones!
I wasn’t familiar with First-Class CPS (thanks for introducing me to this!), but shouldn’t the last line of the Tail-recursive CPS implementation of map be
| x :: r -> let fx = f x in map_cps f r (fun r -> k(fx :: r))
Opam support is still in progress. We have something that seems to work, but we need a bit more testing and haven’t updated yet the instructions in the readme. We hope to have instructions that boil down to “add the janestreet-bleeding repo, then install this opam package”, but finding how to generate our opam package correctly took a while and it’s possible that some subtle bugs are still hidden somewhere.
I’m curious about your opinion about “Compiling without continuations” https://dl.acm.org/doi/pdf/10.1145/3062341.3062380 . Some body may think that continuations are unneeded complication comparately to direct approaches. What are the cases when CPS representation works better than conventional ones (=Haskell)?
As far as I can tell, we’re doing exactly what they propose, but they worry about continuations being interpreted as first-class functions so they call them join-points, while we don’t care and call them continuations.
This is about first-class CPS, so our second-class CPS compilation scheme will not have any impact on those issues.