Domain-Specific Languages Syllabus
Something I spend a lot of time thinking about is how to use the right tool for the task, in programming and otherwise. It was this, rather than a love for logic or formal semantics, that made me fall in love with the study of programming languages. (Although I did go to logic summer camp as a kid...) For this reason, I strongly believe that every programming language is a domain-specific language and we should regard and evaluate languages through the lenses of their domains.
When I first joined Carnegie Mellon University as an Assistant Profesor, I had the luxury of designing a PhD seminar on any topic of my choosing. What I wanted to do was to give students a tour of how I think about designing and implementing programming languages, with the view that we're looking at each language in the context of its domain. Here is the syllabus for my advanced topics domain-specific languages course at CMU, fall 2016. In this course, we open with overview of languages for different purposes and then do deep dives into three domains I've worked in: systems programming, information flow security, and biology.
Since people have been asking about the reading list, I thought I'd post it here. I hope it's a useful resource for people hoping to get a broader context for thinking about programming languages and language design.
Unit 1: Why domain-specific languages?
- To make things pretty. We look at how DSLs improve functional reactive programming.
- To make things fast. We look at DSLs for high-performance computing in graphics.
- To make things correct. We look at the specification and verification of software-defined networks.
- Some combination of the above. We look at languages for scientific programming.
- Analyzing programs for interesting properties. We look at how Resource-Aware ML can give us bounds we never previously dreamed of.
Unit 2: How to build domain-specific languages?
- Embedding languages into other languages. Making languages gets easier and easier as we can just hijack the machinary from another language. We look at how to make EDSLs in Ruby, Scala, and Haskell.
- Implementing standalone DSLs. A closer look at LLVM and other techniques.
- Staging. We look at meta-programming techniques that can help with implementing DSLs.
- Adding types to existing languages. You don't even need to make a language to make a language! We look at typed scheme, gradual types, and languages that add more types to a language that already has types.
Unit 3: Language-based approaches to systems programming
- What's hard about systems programming? An overview of what people do with systems programming, the kinds of mistakes they make, and techniques people have developed to prevent bugs in low-level code.
- Typing low-level languages. We look at typed assembly and Cyclone, early efforts to make low-level coding safe.
- Proving OS correctness, before and after memory safety. We compare the SeL4 and Verve OS verification projects.
- The new systems languages. We look at Rust, an effort to clean up systems programming.
- Evaluation of performance and productivity metrics of potential programming languages in the HPC environment
- Ownership is Theft: Experiences Building an Embedded OS in Rust
- Ownership Types for Safe Programming
- Practical Affine Types
- Typestate: A Programming Language Concept for Enhancing Software Reliability
Unit 4: Language-based information flow
- Languaged-based information flow. We introuduce the notion of information flow security. We look at the decentralized label-based approach with Jif and SIF and compare with systems-based approaches.
- A system-based approach in a high-level language. We take a close look at the LIO monad and Hails operating system and discuss 1) how it uses Haskell for guarantees and 2) how it combines language- and system-based approaches.
- Type-based security. We look at Fine and F* and how dependent types and proof-carrying code can give us security guarantees.
- Changing the language semantics for information flow. We look at my work on policy-agnostic programming with Jeeves and Jacqueline.
Unit 5: Languages for modelling biology
- Executable biology and executable knowledge. An introduction to language-based approaches for modelling biological systems.
- Verification and synthesis with boolean networks. We can apply program-level techniques to biological models once we represent them the same way!
- Rule-based modeling. We look at the design of Kappa and the simulation of Kappa programs.
- Static analysis of rule-based models. Once we have rule-based models, we can analyze them using program analysis. We look at abstract interpretation analyses over Kappa.
We looked at a couple more topics upon student request.
- Voting. We look at the domain of electronic voting and how languages work might help.
- The physical world. We look at a compiler for 3D machine knitting, and the language questions associated with that.