KIT | KIT-Bibliothek | Impressum | Datenschutz

Sound Type-Dependent Syntactic Language Extension

Lorenzen, Florian; Erdweg, Sebastian ORCID iD icon 1
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)

Abstract (englisch):

Syntactic language extensions can introduce new facilities into a programming language while requiring little implementation effort and modest changes to the compiler. It is typical to desugar language extensions in a distinguished compiler phase after parsing or type checking, not affecting any of the later compiler phases. If desugaring happens before type checking, the desugaring cannot depend on typing information and type errors are reported in terms of the generated code. If desugaring happens after type checking, the code generated by the desugaring is not type checked and may introduce vulnerabilities. Both options are undesirable. We propose a system for syntactic extensibility where desugaring happens after type checking and desugarings are guaranteed to only generate well-typed code. A major novelty of our work is that desugarings operate on typing derivations instead of plain syntax trees. This provides desugarings access to typing information and forms the basis for the soundness guarantee we provide, namely that a desugaring generates a valid typing derivation. We have implemented our system for syntactic extensibility in a languageindependent fashion and instantiated it for a substantial subset of Java, including generics and inheritance. ... mehr


Download
Originalveröffentlichung
DOI: 10.1145/2837614.2837644
Zugehörige Institution(en) am KIT Institut für Programmstrukturen und Datenorganisation (IPD)
Publikationstyp Proceedingsbeitrag
Publikationsdatum 11.01.2016
Sprache Englisch
Identifikator ISBN: 978-145033549-2
ISSN: 0730-8566
KITopen-ID: 1000188564
Erschienen in Conference Record of the Annual ACM Symposium on Principles of Programming Languages; Saint Petersburg, FL, USA, 20.-22.01.2016
Veranstaltung 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2016), Saint Petersburg, FL, USA, 20.01.2016 – 22.01.2016
Verlag Association for Computing Machinery (ACM)
Seiten S. 204–216
Schlagwörter Automatic verification; Language extensibility; Macros; Metaprogramming; Type soundness; Type-dependent desugaring
Nachgewiesen in Scopus
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page