Agda2Rust: A Study on an Alternative Backend for the Agda Compiler

Bachelor Thesis (2022)
Author(s)

H. Peeters (TU Delft - Electrical Engineering, Mathematics and Computer Science)

Contributor(s)

J.G.H. Cockx – Mentor (TU Delft - Programming Languages)

L.F.B. Escot – Mentor (TU Delft - Programming Languages)

M. T.J. Spaan – Graduation committee member (TU Delft - Algorithmics)

Faculty
Electrical Engineering, Mathematics and Computer Science
Copyright
© 2022 Hector Peeters
More Info
expand_more
Publication Year
2022
Language
English
Copyright
© 2022 Hector Peeters
Graduation Date
27-06-2022
Awarding Institution
Delft University of Technology
Project
CSE3000 Research Project
Programme
Computer Science and Engineering
Faculty
Electrical Engineering, Mathematics and Computer Science
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

Agda is a functional programming language with built-in support for dependent types. A dependent type depends on a value. This allows the developer to specify strict constraints for the types used in an application. Writing code with dependent types results in fewer type-related errors slipping through the compilation process.
When executing Agda code, it is first compiled into a different programming language. This process is called code extraction. This step is applied since most of the typed code becomes unnecessary after type-checking and can therefore be removed. Currently, the Agda compiler supports only Haskell and JavaScript as target languages. However, exploring Rust as a target language could potentially lead to better performance, and it would allow access to the Rust library ecosystem.
Overall, the agda2rust backend could be a viable alternative to what is currently available. While it is not fully feature-complete and will not outperform any existing backends yet, agda2rust provides a way to seamlessly integrate algorithms and data structures implemented and proven in Agda into an existing Rust codebase.

Files

Paper_2.pdf
(pdf | 0.244 Mb)
License info not available