2021
DOI: 10.1145/3473587
|View full text |Cite
|
Sign up to set email alerts
|

Calculating dependently-typed compilers (functional pearl)

Abstract: Compilers are difficult to write, and difficult to get right. Bahr and Hutton recently developed a new technique for calculating compilers directly from specifications of their correctness, which ensures that the resulting compilers are correct-by-construction. To date, however, this technique has only been applicable to source languages that are untyped. In this article, we show that moving to a dependently-typed setting allows us to naturally support typed source languages, ensure that all compilation compon… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
1
1
1

Citation Types

0
3
0

Year Published

2022
2022
2024
2024

Publication Types

Select...
2
1
1

Relationship

2
2

Authors

Journals

citations
Cited by 4 publications
(3 citation statements)
references
References 18 publications
0
3
0
Order By: Relevance
“…This section is based upon (Hutton & Wright, 2006;Hutton & Bahr, 2016), which also show how to calculate machines for extended versions of the expression language and how the two transformation steps can be fused into a single step. Similar techniques can be used to calculate compilers for stack (Bahr & Hutton, 2015) and register machines (Hutton & Bahr, 2017;Bahr & Hutton, 2020), as well as typed (Pickard & Hutton, 2021), non-terminating (Bahr & Hutton, 2022) and concurrent (Bahr & Hutton, 2023) languages.…”
Section: Step 2 -Defunctionalisementioning
confidence: 99%
“…This section is based upon (Hutton & Wright, 2006;Hutton & Bahr, 2016), which also show how to calculate machines for extended versions of the expression language and how the two transformation steps can be fused into a single step. Similar techniques can be used to calculate compilers for stack (Bahr & Hutton, 2015) and register machines (Hutton & Bahr, 2017;Bahr & Hutton, 2020), as well as typed (Pickard & Hutton, 2021), non-terminating (Bahr & Hutton, 2022) and concurrent (Bahr & Hutton, 2023) languages.…”
Section: Step 2 -Defunctionalisementioning
confidence: 99%
“…While they also calculate a compiler for the untyped lambda calculus, the correctness theorem on which the calculation is based only makes guarantees about terminating source programs. More recently, Pickard and Hutton [2021] extended this methodology to a dependently typed-setting to account for typed source languages. Bahr [2015] showed how to calculate compilers for non-deterministic languages, but as noted in section 4.5 this approach is complicated by the need to carefully manage side conditions.…”
Section: Related Workmentioning
confidence: 99%
“…Moreover, the monadic approach allows us to maintain the familiar equational reasoning style for calculations. Interesting topics for further work include: dealing with multiple effects by compiling them away one at a time, leading to multi-stage compilers; combining the technique with a dependently-typed approach to compiler calculation [Pickard and Hutton 2021]; and considering how it may be adapted to register-based machines [Bahr and Hutton 2020].…”
Section: Conclusion and Further Workmentioning
confidence: 99%