CS 106 Videos

Instructor’s videos

Module 11: Garbage collection

April 12

Introduction to module 11. [0:00] Garbage collection and why it matters. [1:11] Comparisons with the state of the art. [1:45] What I expect the GC-building experience to be like.

April 12

Garbage-collection basics. Roots, live data, graph traversal. Copying collection as a way to eliminate fragmentation of free space.

More trouble than usual with autofocus and audio tech.

Module 10: Closure conversion

April 5

Introduction to module 10. What to expect from closure conversion.

Module 9: K-Normalization

March 28

Introduction to module 9. [0:01] The big idea of K-normalization: putting values in registers. [1:40] Continuation-passing style for register allocation [2:25] The other significant piece: environments. [3:44] Code infrastructure you’ll be building. [4:38] Wrapup: what to expect.

Module 8: Calls in the UFT

March 8

Introduction to module 8. A light week of coding: generating calls, tail calls, and returns; code for functions.

Module 7: Calls in the SVM

March 1

Introduction to module 7. What’s ahead: implementing procedure calls using two stacks. Tail-call optimization. Depth points.

March 2

Don’t use the wildcard at top level. That is all.

Module 6: Code generation

February 22

Introduction to module 6. This week we’re implementing new instances of concepts we just saw: translation, projection, and the UFT driver. The key is the translation: from K-normal form, we’ll generate assembly code. Good stuff!

Module 5: Disambiguation and K-normal form

February 15

Quick comments on module 4. Nice work on parsers and label elimination. One note: the shiny Parsec combinators from Haskell are easily duplicated in ML.

February 15

Introduction to module 5. Coming this week: identifying different roles of names, and at last a functional language inside our compiler: K-normal form.

February 15

High-level languages and the UFT. This video shows how the second half of the system is built in modules 5 through 10: K-normal form, first-order vScheme, unambiguous vScheme, and vScheme itself. The video also depicts the entire translation pipeline from vScheme source code to running VM code in the SVM.

February 15

Embedding, projection, disambiguation, and K-normal form. This video goes over the three ways we’ll use embedding and projection in our project. Two you’ve done already, and the third is to embed K-normal form in Scheme. But most of the video is devoted to a demo in which I convert ordinary Scheme code into code that can successfully be projected in to K-normal form.

This is not one of my best videos, but K-normal form is the most important intermediate code in our system, and you’ll learn a lot that will be useful in modules 5, 6, and 9.

Module 4: The assembler

Jan 25

Low-level languages and the UFT. This video shows how the first half of the system is built in modules 1 through 4: assembly language, virtual object code, their internal representations, their representations on disk, and the translation between them. The video also includes a short demo for the two main use cases of uft so far.

February 8

Introduction to module 4. - A week of consolidation. The last push for instructions. - Your second translator. - Testing!

Module 3: Assembly-language syntax, unparsing

February 8

Quick observations after module 3 code review. The roles of assembly language and object code.

February 1

Introduction to module 3. (With bad audio, due to software.) [0:00] Welcome [0:28] Memory management [1:01] On to the UFT! Functional programming. New language: assembly language. [2:35] What to expect from module 2: New code base; building on your parsing experience. [3:40] Getting ready for lab. Exercises!

TBA

Making types work for you. This is an all-screen-capture demo of how to use types to derive code for a function. It’s similar to one of the 105 lectures on the same topic, but with a different example: the Kleisli composition function >=>. Low production values, but it might be useful.

February 1

What parsing combinators can do for us. Examples from my parser for vScheme: Simple parsing in sequences with >>. The idea of failure. Build an abstract-syntax tree using curry, <$>, and <*>. Signaling syntax errors with perror.

(Sorry the audio is duff on this one. Something went wrong with my main mic, and this audio is from the backup mic.)

February 1

Embedding and projection, part 2: Parsing and unparsing Scheme. This video presents the second of several examples of embedding and projection. This time we’re embedding and projecting programs. Nothing here is urgent, but it will be a good idea to watch before you turn in your reflection for module 3.

Module 2: VM loader, introduction to parsing

Jan 25

Introduction to module 2. Brief comments on last week. Purpose of learning outcomes. Climbing the mountain. Destination: vScheme. Next step (virtual object code) write code in a file, code can include literals. New skill: parsing.

Jan 25

“What” and “why” of parsing. What parsing is. Why it’s useful to study. Avoiding yacc. Why we’re studing LL parsing (and later, parsing combinators).

Jan 25

Demonstration of recursive-descent parsing. Grammar for virtual object code. Conversion to railroad diagrams. Implementation of railroad diagram in C.

Module 1: VM State

Jan 18

The course work model. The “flipped classroom.” Our work cycle, which runs Wednesday to Tuesday.

Introduction to module 1. The core of the SVM. What distinguishes the SVM: high-level language values, you get to design VM instructions.
Not much code this week, and it might all get written during lab. Knock rust off your C skills, immigrate into thinking about virtual machines, build on COMP 15 and COMP 40. A dollop of operational semantics, so we can optimize recursion in week 7 (we will help). Staff are here to help; the place to start is Slack.

Jan 18

Introduction to embedding and projection. Focused on VM values, with a little bit about mathematical numbers and machine instructions.

This is not quite my worst video ever (that would be the version from 2020), but it’s clear my skills have atrophied. And being stuck with the laptop camera didn’t help.

Overview videos

Jan 18

Overview and welcome. My goals for the course. The idea of a simple virtual machine. Your takeaways. Some information about logistics: small deliverables with frequent deadlines. Plans for class meetings. Something about me and why I’m teaching this course.

Jan 24

All translations, front to back. This video shows what the system does but not how it is built. It shows an example of each form that a simple function goes through, starting with higher-order vScheme and ending with virtual object code. It also shows a quick snippet of debugging technique!

Jan 25

Low-level languages and the UFT. This video shows how the first half of the system is built in modules 1 through 4: assembly language, virtual object code, their internal representations, their representations on disk, and the translation between them. The video also includes a short demo for the two main use cases of uft so far.

February 15

High-level languages and the UFT. This video shows how the second half of the system is built in modules 5 through 10: K-normal form, first-order vScheme, unambiguous vScheme, and vScheme itself. The video also depicts the entire translation pipeline from vScheme source code to running VM code in the SVM.