KIT | KIT-Bibliothek | Impressum | Datenschutz

Layout-sensitive Language Extensibility with SugarHaskell

Erdweg, Sebastian ORCID iD icon 1; Rieger, Felix; Rendel, Tillmann; Ostermann, Klaus
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)

Abstract (englisch):

Programmers need convenient syntax to write elegant and concise programs. Consequently, the Haskell standard provides syntactic sugar for some scenarios (e.g., do notation for monadic code), authors of Haskell compilers provide syntactic sugar for more scenarios (e.g., arrow notation in GHC), and some Haskell programmers implement preprocessors for their individual needs (e.g., idiom brackets in SHE). But manually written preprocessors cannot scale: They are expensive, error-prone, and not composable. Most researchers and programmers therefore refrain from using the syntactic notations they need in actual Haskell programs, but only use them in documentation or papers. We present a syntactically extensible version of Haskell, SugarHaskell, that empowers ordinary programmers to implement and use custom syntactic sugar. Building on our previous work on syntactic extensibility for Java, SugarHaskell integrates syntactic extensions as sugar libraries into Haskell's module system. Syntax extensions in SugarHaskell can declare arbitrary context-free and layout-sensitive syntax. SugarHaskell modules are compiled into Haskell modules and further processed by a Haskell compiler. ... mehr


Zugehörige Institution(en) am KIT Institut für Programmstrukturen und Datenorganisation (IPD)
Publikationstyp Proceedingsbeitrag
Publikationsjahr 2012
Sprache Englisch
Identifikator ISBN: 978-145031574-6
KITopen-ID: 1000188534
Erschienen in Haskell'12 - Proceedings of the 2012 ACM SIGPLAN Haskell Symposium 2012; Kopenhagen, Dänemark, 13.-14.09.2012
Veranstaltung ACM SIGPLAN Haskell Symposium, Haskell 2012 (2012), Kopenhagen, Dänemark, 13.09.2012 – 14.09.2012
Verlag Association for Computing Machinery (ACM)
Seiten S. 149–160
Schlagwörter arrows; dsl embedding; haskell; language composition; language extension; layout-sensitive parsing; sugarhaskell; sugarj; syntactic sugar
Nachgewiesen in Scopus
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page