Twig: A Configurable Domain-Specific Language

Date and time: 
Tue, May 29 2012 - 10:00am to Wed, May 30 2012 - 9:45am
Location: 
220 Deschutes
Speaker(s):
Geoffrey Hulette
University of Oregon
Host/Committee: 
  • Allen Malony (Chair)
  • Michal Young
  • Zena Ariola
  • Shawn Lockery
  • Matthew Sottile

Programmers design, write, and understand programs with a high-level structure in mind. Existing programming languages are not very good at capturing this structure because they must include low-level implementation details. To address this problem we introduce Twig, a programming language that allows for domain-specific logic to be encoded alongside low-level functionality. Twig's language is based on a simple, formal calculus that is amenable to both human and machine reasoning. Users may introduce rules that rewrite expressions, allowing for user-defined optimizations. Twig can also incorporate procedures written in a variety of low-level languages. Our implementation supports C and Python, but our abstract model can accomodate other languages as well. I will present Twig's design and formal semantics, and discuss our implementation. Then I will demonstrate Twig's use in two different domains, multi-language programming, and GPU programming, and finally compare Twig against a well-known typemapping system, SWIG.