License: Creative Commons Attribution 4.0 International license (CC BY 4.0)
When quoting this document, please refer to the following
DOI: 10.4230/OASIcs.EVCS.2023.22
URN: urn:nbn:de:0030-drops-177926
Go to the corresponding OASIcs Volume Portal

Reinders, Jaro S.

Towards Modular Compilation Using Higher-Order Effects

OASIcs-EVCS-2023-22.pdf (0.5 MB)


Compilers transform a human readable source language into machine readable target language. Nanopass compilers simplify this approach by breaking up this transformation into small steps that are more understandable, maintainable, and extensible. We propose a semantics-driven variant of the nanopass compiler architecture exploring the use a effects and handlers to model the intermediate languages and the transformation passes, respectively. Our approach is fully typed and ensures that all cases in the compiler are covered. Additionally, by using an effect system we abstract over the control flow of the intermediate language making the compiler even more flexible. We apply this approach to a minimal compiler from a language with arithmetic and let-bound variables to a string of pretty printed X86 instructions. In the future, we hope to extend this work to compile a larger and more complicated language and we envision a formal verification framework from compilers written in this style.

BibTeX - Entry

  author =	{Reinders, Jaro S.},
  title =	{{Towards Modular Compilation Using Higher-Order Effects}},
  booktitle =	{Eelco Visser Commemorative Symposium (EVCS 2023)},
  pages =	{22:1--22:9},
  series =	{Open Access Series in Informatics (OASIcs)},
  ISBN =	{978-3-95977-267-9},
  ISSN =	{2190-6807},
  year =	{2023},
  volume =	{109},
  editor =	{L\"{a}mmel, Ralf and Mosses, Peter D. and Steimann, Friedrich},
  publisher =	{Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
  address =	{Dagstuhl, Germany},
  URL =		{},
  URN =		{urn:nbn:de:0030-drops-177926},
  doi =		{10.4230/OASIcs.EVCS.2023.22},
  annote =	{Keywords: algebraic effects and handlers, higher-order effects, monadic semantics, modularity, compilation, nanopass}

Keywords: algebraic effects and handlers, higher-order effects, monadic semantics, modularity, compilation, nanopass
Collection: Eelco Visser Commemorative Symposium (EVCS 2023)
Issue Date: 2023
Date of publication: 21.03.2023
Supplementary Material: Software (Source Code): archived at:

DROPS-Home | Fulltext Search | Imprint | Privacy Published by LZI