Notes on Types and Programming Languages

Nov 30, 2024 * programming, type theory, notes

Contents

This is a live document, and will be updated as I read through the book.

I've recently taken to reading Types and Programming Languages by Benjamin C. Pierce in an attempt to introduce myself to the basics of type theory and the like. The book in question is, from what I've found, considered an apt introduction to the aforementioned concepts, and seems to read well from my brief skimming of it thus far. I'll be using this document to consolidate my notes on the content as I read.

The book mentions a mature understanding of mathematics, mainly discrete math, algorithms, and logic, namely as a product of rigorous undergraduate coursework, and familiarity with at some higher-order function programming language as a precursory requirement: none of which I satisfactorily meet. I suppose I'll have to see how much of this will fly over my head.

Chapter 1: Introduction

This chapter defines what a "type system" is, and provides some relevant background.

Chapter 3: Untyped Arithmetic Expressions

The book establishes the following grammar for a very basic language of numbers and booleans.

t ::=                           terms:
    true                        constant true
    false                       constant false
    if t then t else t          conditional
    0                           constant 0
    succ t                      sucessor
    pred t                      predecessor
    iszero t                    zero test