Safely Composable Type-Specific Languages

Cyrus Omar, Darya Kurilova, Ligia Nistor, Benjamin Chung, Alex Potanin, Jonathan Aldrich

Research output: Chapter in Book/Report/Conference proceedingConference Paperpeer-review

27 Citations (Scopus)

Abstract

Programming languages often include specialized syntax for common datatypes (e.g. lists) and some also build in support for specific specialized datatypes (e.g. regular expressions), but user-defined types must use general-purpose syntax. Frustration with this causes developers to use strings, rather than structured data, with alarming frequency, leading to correctness, performance, security, and usability issues. Allowing library providers to modularly extend a language with new syntax could help address these issues. Unfortunately, prior mechanisms either limit expressiveness or are not safely composable: individually unambiguous extensions can still cause ambiguities when used together. We introduce type-specific languages (TSLs): logic associated with a type that determines how the bodies of generic literals, able to contain arbitrary syntax, are parsed and elaborated, hygienically. The TSL for a type is invoked only when a literal appears where a term of that type is expected, guaranteeing non-interference. We give evidence supporting the applicability of this approach and formally specify it with a bidirectionally typed elaboration semantics for the Wyvern programming language.

Original languageEnglish
Title of host publicationECOOP 2014 - Object-Oriented Programming
Subtitle of host publication28th European Conference, Proceedings
EditorsRichard Jones
Place of PublicationHeidelberg
PublisherSpringer
Pages105-130
Number of pages26
ISBN (Electronic)978-3-662-44202-9
ISBN (Print)978-3-662-44201-2
DOIs
Publication statusPublished - 2014
Externally publishedYes
Event28th European Conference on Object-Oriented Programming, ECOOP 2014 - Uppsala, Sweden
Duration: 28 Jul 20141 Aug 2014

Publication series

NameLecture Notes in Computer Science
Volume8586 (LNPSE)
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Conference

Conference28th European Conference on Object-Oriented Programming, ECOOP 2014
Country/TerritorySweden
CityUppsala
Period28/07/141/08/14

Fingerprint

Dive into the research topics of 'Safely Composable Type-Specific Languages'. Together they form a unique fingerprint.

Cite this