An Intrinsically Typed Compiler for Algebraic Effect Handlers
A type-preserving compiler converts a well-typed input program into a well-typed output program.
Previous studies have developed type-preserving compilers for various source languages,
including the simply-typed lambda calculus and calculi with control constructs.
Our goal is to realize type-preserving compilation of languages that have facilities for manipulating first-class continuations.
In this paper, we focus on algebraic effects and handlers, a generalization of exceptions and their handlers with resumable continuations.
Specifically, we choose an effect handler calculus and a typed stack-machine-based assembly language as the source and the target languages, respectively, and formalize the target language and a type preserving compiler.
The main challenge posed by first-class continuation is how to ensure safety of continuation capture and resumption, which involves concatenation of unknown stacks.
We solve this challenge by incorporating stack polymorphism, a technique that has been used for compilation from a language without first-class continuations to a stack-based assembly language.
To prove that our compiler is type preserving, we implemented the compiler in Agda as a function between intrinsically typed ASTs.
We believe that our contributions could lead to correct and efficient compilation of continuation-manipulating facilities in general.
Tue 16 JanDisplayed time zone: London change
14:00 - 15:30 | |||
14:00 25mTalk | An Intrinsically Typed Compiler for Algebraic Effect Handlers PEPM Syouki Tsuyama Tokyo Institute of Technology, Youyou Cong Tokyo Institute of Technology, Hidehiko Masuhara Tokyo Institute of Technology DOI | ||
14:25 25mTalk | Ownership Types for Verification of Programs with Pointer Arithmetic PEPM Izumi Tanaka University of Tokyo, Ken Sakayori University of Tokyo, Naoki Kobayashi University of Tokyo DOI | ||
14:50 25mTalk | Scoped and Typed Staging by EvaluationRemote PEPM Guillaume Allais University of Strathclyde DOI Pre-print | ||
15:15 15mTalk | One-Pass CPS Translation of Dependent Types (Talk Proposal) PEPM Youyou Cong Tokyo Institute of Technology Pre-print |