Notes on Continuations

June 18, 2019

These are some notes I gave out at one of my weekly recitations when I was teaching 15-312 Principles of Programming Languages at CMU in April 2017. Continuations have a fascinating analogy with proofs by contradiction that I might flesh out into a proper post in the future, but for now here are some rough recitation notes.

They’re best understood with Chapter 30 of Practical Foundations for Programming Languages open. (Unfortunately this chapter isn’t available in the online preview of the 2nd edition. I’m happy to lend you my hard copy if I know you IRL.)

Continuations

Abstract:

Continuations allow for lots of things. Intuitively, we can think of continuations as “functions that never come back.” That is, continuations transfer control to some other part of your program. In a way, continuations are like a much nicer version of goto. But they’re way more than this—specifically, they reify the concept of a “proof by contradiction” into the type system.

Read More

Surgery on codebases from the CLI

One problem that comes up all the time for me is needing to manipulate files only on specific lines. Like, “find and replace this pattern, but only on specific lines.” In this post, I’ll introduce the CLI tools I’ve made to solve this class of problems with some examples. Continue reading

On Programming Language Choice

Published on June 21, 2019

A Debugger for Bash in Six Lines of Bash

Published on June 16, 2019