Programming Language Design

Overview


At this point, you’ve practiced programming with (at least) two programming languages. Dart was a multi-purpose language, while Gleam was a functional language. You’ve also worked on parsing with both Dart and Gleam, transforming text into other forms.

In this part, we’ll take the first steps towards understanding the theory of programming languages, while still maintaining a hands-on approach that concretely demonstrates the concepts. The structure of this part is as follows:

  • From BASIC to Lambda Calculus discusses the progression from line-based execution to stack-based execution models, briefly introducing lambda calculus as a formalism for programming languages.
  • Parsing and Recursion shows the construction of a parser for a prefix-style arithmetic language, including converting input into parse trees and abstract syntax trees.
  • Building a Calculator outlines evaluation for converting an abstract syntax tree into numerical results, enabling also interactive use via a Read-Evaluate-Print Loop (REPL).
  • Theory of Programming Languages discusses foundational concepts in programming language theory, emphasizing statics (type systems and program formation) and dynamics (evaluation and execution), and outlines inference rules, formation rules, and evaluation rules as tools for describing programming languages.
  • Boolean Expression Language briefly highlights the syntax and evaluation of a simple boolean expression language (if-then-else), including the use of syntax sugar for readability.
  • Type Systems and Type Checking introduces type systems and type checking for ensuring program correctness before execution, focusing on deducing types of expressions.
  • Parser Combinators and Lisp discusses the possibility of creating parser combinators that combine parsers to create parsers, and helps you work through creating a simple Lisp-like language parser.

Finally, at the end, the chapter Recap and Feedback provides a summary of the part and asks for feedback on the materials.