Safely Composable Type Specific Languages

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 noninterference. We give evidence supporting the applicability of this approach and formally specify it with a bidirectionally typed elaboration semantics for the Wyvern programming language.

Open PDF

Document Details

Document Type
Technical Report
Publication Date
Aug 01, 2014
Accession Number
AD1057425

Entities

People

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

Organizations

  • Carnegie Mellon University

Tags

Communities of Interest

  • Cyber
  • Energy and Power Technologies

DTIC Thesaurus Topics

  • Abstracts
  • Air Force
  • Air Force Research Laboratories
  • Ambiguity
  • Compilers
  • Computer Programming
  • Computer Programs
  • Concrete
  • Generators
  • Grammars
  • Graphical User Interface
  • Judgment
  • Language
  • Notation
  • Programming Languages
  • Standards
  • United States

Fields of Study

  • Computer science

Readers

  • Computational Linguistics
  • Enterprise Information Systems Architecture and Joint Command Capability Interoperability Support.