Programming Type-Safe Transformations Using Higher-Order Abstract Syntax

Abstract. Compiling syntax to native code requires complex code trans-formations which rearrange the abstract syntax tree. This can be partic-ularly challenging for languages containing binding constructs, and often leads to subtle, hard to find errors. In this paper, we exploit higher-order abstrac...

Full description

Bibliographic Details
Main Authors: Olivier Savary-belanger, Stefan Monnier, Brigitte Pientka
Other Authors: The Pennsylvania State University CiteSeerX Archives
Format: Text
Language:English
Published: Springer-Verlag 2013
Subjects:
Online Access:http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.671.6517
http://www.cs.mcgill.ca/%7Ebpientka/papers/cc.pdf
id ftciteseerx:oai:CiteSeerX.psu:10.1.1.671.6517
record_format openpolar
spelling ftciteseerx:oai:CiteSeerX.psu:10.1.1.671.6517 2023-05-15T15:41:50+02:00 Programming Type-Safe Transformations Using Higher-Order Abstract Syntax Olivier Savary-belanger Stefan Monnier Brigitte Pientka The Pennsylvania State University CiteSeerX Archives 2013 application/pdf http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.671.6517 http://www.cs.mcgill.ca/%7Ebpientka/papers/cc.pdf en eng Springer-Verlag http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.671.6517 http://www.cs.mcgill.ca/%7Ebpientka/papers/cc.pdf Metadata may be used without restrictions as long as the oai identifier remains attached to it. http://www.cs.mcgill.ca/%7Ebpientka/papers/cc.pdf text 2013 ftciteseerx 2016-01-08T17:23:55Z Abstract. Compiling syntax to native code requires complex code trans-formations which rearrange the abstract syntax tree. This can be partic-ularly challenging for languages containing binding constructs, and often leads to subtle, hard to find errors. In this paper, we exploit higher-order abstract syntax (HOAS) to implement a type-preserving compiler for the simply-typed lambda-calculus, including transformations such as closure conversion and hoisting, in the dependently-typed language Beluga. Un-like previous implementations, which have to abandon HOAS locally in favor of a first-order binder representation, we are able to take advantage of HOAS throughout the compiler pipeline, so that we do not have to include any lemmas about binder manipulation. Scope and type safety of the code transformations are statically guaranteed, and our imple-mentation directly mirrors the proofs of type preservation. Our work demonstrates that HOAS encodings offer substantial benefits to certified programming. 1 Text Beluga Beluga* Unknown Lambda ENVELOPE(-62.983,-62.983,-64.300,-64.300)
institution Open Polar
collection Unknown
op_collection_id ftciteseerx
language English
description Abstract. Compiling syntax to native code requires complex code trans-formations which rearrange the abstract syntax tree. This can be partic-ularly challenging for languages containing binding constructs, and often leads to subtle, hard to find errors. In this paper, we exploit higher-order abstract syntax (HOAS) to implement a type-preserving compiler for the simply-typed lambda-calculus, including transformations such as closure conversion and hoisting, in the dependently-typed language Beluga. Un-like previous implementations, which have to abandon HOAS locally in favor of a first-order binder representation, we are able to take advantage of HOAS throughout the compiler pipeline, so that we do not have to include any lemmas about binder manipulation. Scope and type safety of the code transformations are statically guaranteed, and our imple-mentation directly mirrors the proofs of type preservation. Our work demonstrates that HOAS encodings offer substantial benefits to certified programming. 1
author2 The Pennsylvania State University CiteSeerX Archives
format Text
author Olivier Savary-belanger
Stefan Monnier
Brigitte Pientka
spellingShingle Olivier Savary-belanger
Stefan Monnier
Brigitte Pientka
Programming Type-Safe Transformations Using Higher-Order Abstract Syntax
author_facet Olivier Savary-belanger
Stefan Monnier
Brigitte Pientka
author_sort Olivier Savary-belanger
title Programming Type-Safe Transformations Using Higher-Order Abstract Syntax
title_short Programming Type-Safe Transformations Using Higher-Order Abstract Syntax
title_full Programming Type-Safe Transformations Using Higher-Order Abstract Syntax
title_fullStr Programming Type-Safe Transformations Using Higher-Order Abstract Syntax
title_full_unstemmed Programming Type-Safe Transformations Using Higher-Order Abstract Syntax
title_sort programming type-safe transformations using higher-order abstract syntax
publisher Springer-Verlag
publishDate 2013
url http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.671.6517
http://www.cs.mcgill.ca/%7Ebpientka/papers/cc.pdf
long_lat ENVELOPE(-62.983,-62.983,-64.300,-64.300)
geographic Lambda
geographic_facet Lambda
genre Beluga
Beluga*
genre_facet Beluga
Beluga*
op_source http://www.cs.mcgill.ca/%7Ebpientka/papers/cc.pdf
op_relation http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.671.6517
http://www.cs.mcgill.ca/%7Ebpientka/papers/cc.pdf
op_rights Metadata may be used without restrictions as long as the oai identifier remains attached to it.
_version_ 1766374714568081408