I am excited to announce that our paper "Back to Direct Style: Typed and Tight" has been accepted at OOPSLA'23.
We present a typed translation, which allows compilers to go to CPS, perform optimizations, and go back to direct-style (DS).
The translation...
- preserves well-typedness
- preserves semantics
- is a syntactic right-inverse of the CPS translation (that is, going to CPS and back is the identity)
- it is a left-inverse of the CPS translation, if DS programs don't use control effects
https://se.cs.uni-tuebingen.de/publications/mueller23continuation/
Here is an example from the paper: