Towards Modular Compilation Using Higher-Order Effects

Jaro S. Reinders*

*Corresponding author for this work

Research output: Chapter in Book/Conference proceedings/Edited volumeConference contributionScientificpeer-review

34 Downloads (Pure)

Abstract

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.

Original languageEnglish
Title of host publicationEelco Visser Commemorative Symposium, EVCS 2023
EditorsRalf Lammel, Peter D. Mosses, Friedrich Steimann
PublisherSchloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
Number of pages9
ISBN (Electronic)9783959772679
DOIs
Publication statusPublished - 2023
Event2023 Eelco Visser Commemorative Symposium, EVCS 2023 - Delft, Netherlands
Duration: 5 Apr 20235 Apr 2023

Publication series

NameOpenAccess Series in Informatics
Volume109
ISSN (Print)2190-6807

Conference

Conference2023 Eelco Visser Commemorative Symposium, EVCS 2023
Country/TerritoryNetherlands
CityDelft
Period5/04/235/04/23

Keywords

  • algebraic effects and handlers
  • compilation
  • higher-order effects
  • modularity
  • monadic semantics
  • nanopass

Fingerprint

Dive into the research topics of 'Towards Modular Compilation Using Higher-Order Effects'. Together they form a unique fingerprint.

Cite this