MIL, a Monadic Intermediate Language for Implementing Functional Languages

MIL, a Monadic Intermediate Language for Implementing Functional Languages

Mark P. Jones, Justin Bailey, and Theodore R. Cooper. In Proceedings of the 30th Symposium on Implementation and Application of Functional Languages (IFL 2018), September 5--7, 2018, Lowell, MA, USA.


Abstract:

This paper describes MIL, a "monadic intermediate language" that is designed for use in optimizing compilers for strict, strongly typed functional languages. By using a notation that exposes the construction and use of closures and algebraic datatype values, for example, the MIL optimizer is able to detect and eliminate many unnecessary uses of these structures prior to code generation. One feature that distinguishes MIL from other intermediate languages in this area is the use of a typed, parameterized notion for basic blocks. This both enables new optimization techniques, such as the ability to create specialized versions of basic blocks, and leads to a new approach for implementing changes in data representation.


Acknowledgement:

This work was supported in part by funding from the National Science Foundation, Award No. CNS-1422979.


Availability:

A PDF version of the paper is available by http in pdf. © Mark P. Jones, Justin Bailey, and Theodore R. Cooper. This is the authors' version of the work. It is posted here for your personal use. Not for redistribution. The definitive version was published in the Proceedings of the 30th Symposium on Implementation and Application of Functional Languages (IFL 2018), September 5--7, 2018, Lowell, MA, USA, https://doi.org/10.1145/3310232.3310238.

Source code for the tools described in the paper is available from https://github.com/habit-lang/mil-tools.