When: Mondays 4-7pm
Where: GEO 2.218
Instructor: Dr. Greg Lavender
Office/Hours: TAY 4.115D / M 10-12, W 10-11
In this graduate-level depth course we will investigate language design ideas and practical features that are required of a Domain Specific Language (DSL) to better answer the question: What is a DSL really?
For example, Scheme has a powerful macro system that allows for syntactic extension in terms of a core set of primitives on which the language is built. Is this core sufficient to define a DSL using just syntactic extension? Could something like GNU Guile be used as the basis of a DSL with a domain specific syntax and parser built on top of the semantically well-defined Scheme core realized by the Guile run-time library?
Alternatively, are polymorphic type systems sufficient to express DSLs? In C++, Java, C# you can define arbitrary abstractions using classes, generics and function/operator overloading and effectively embed a domain-specific sublanguage within a general purpose language, but restricted to the fixed syntax and semantics imposed by the encompassing language definition. Is this an effective way to define a DSL? Or do we need to be able to extend the syntax and semantics?
Are extensible scripting languages effective platforms for DSLs? For example, Tcl provides a dynamically typed extensible language and a flexible binding and substitution mechanism as a way to define "mini" languages by binding new names, thereby extending the core Tcl syntax, to underlying C/C++ code that implements new semantics (e.g., Tk). Is Tcl a suitable framework for definining a DSL? Are other extensible scripting languages suitable?
After looking into these language design and technical issues, we will explore the following questions:
Such a toolkit would have to include syntax definition and extension mechanisms, type definition, extension, and checking mechanisms, functional/expression sublanguages, sequential/concurrent/exceptional control mechanisms, various forms of name binding, substitution rules and scoping rules, etc., and an operational semantics realized via an interpreter, compiler or virtual machine that could be incrementally extended, be efficiently implemented, and kept semantically correct. This is a complex language research problem that has applicability to many current issues in the area of systems, for example: DSLs for robotics, gaming, embedded computing, network programming, parallel & distributed computing, system management/monitoring, etc.
The course will hopefully result in some new ideas on how to design languages to be extensible in various ways and identify which language mechanisms are key to realizing DSLs. We will also explore some of the underlying lambda calculi and type theory required to realize components of such a toolkit and identify their strengths, and inadequacies.
Ideally, students will have taken CS386L (Graduate Programming Languages) or otherwise have familiarity with basic concepts from syntactic & semantic theories of programming languages. A quick review of these concepts will be done at the start of the course to get everyone in sync. Familiarity with at least one functional language (e.g., Scheme/Lisp, Haskell, ML) and one object-oriented language (e.g., C++, Java, C#) will be beneficial.
The course will involve studying existing syntactic & semantic language specifications, reading technical research papers on DSL concepts, and engaging in technical discussion based on examples from real languages. The goal will be to gain deep technical understanding and new insight into how to design useful and well-founded domain specific languages. We will attempt to design and implement one or more DSLs using GNU Guile, or some other suitable platform as a starting point, to pragmatically experiment with these ideas within the timeframe of a one-semester course.
The textbook, Essentials of Programming Languages, 2nd Ed., has been selected for this course as it takes an incremental approach to language design and interpreter construction. We will also read several historical and current research papers in the area of programming languages.
Students should have familiarity with the content of at least one of the following books as background for this course. We will cover some of this material at the start of the course as a refresher:
Publically available papers on DSLs. A more focused set of papers will be read during the course.