Skip to content

CS421

CS421 (Programming Languages and Compilers) is a 3-credit hour course that counts as an Advanced Computing elective for CE, a technical elective for EE, and is explicitly required for CS majors.

Content Covered

Functional Programming

  • Pattern Matching and Recursion
  • Continuation Passing Style
  • Currying
  • Higher Order Functions
  • Abstract Data Types

Programming Languages

  • Abstract Syntax Trees
  • Type Checking, Inference, and Unification
  • Lexing and Lexer Generators
  • Parsing and Parser Generators
  • CPS Transformation
  • Natural semantics
  • Lambda Calculus
  • Hoare Logic

This course teaches students functional programming, and the theory and implementation behind interpreters / compilers. Students learn OCaml, and use it for all assignments and midterms. Throughout the course they will use OCaml to build a lexer, parser, type checker, and evaluator for a toy functional programming language called PicoML.

Prerequisites

ECE majors are expected to show programming maturity through a higher level programming course, usually this is ECE391. However this requirement is not enforced and it is recommended to email the professor to get a pre-requisite override if needed. Context free grammars from CS374 are reviewed and applied while covering paring theory.

When to Take it

For ECE majors, CS421 is taken either as an easy technical / advanced computing elective or to fulfill prerequisite requirements for other CS classes (CS426 - Compiler Construction). If taking this class just because it is a prequisite, instead first try to get an override so you don't have to take it. For CS majors, this class is required, but is not a preqreqisite for any other required class, so feel free to put it off until the last semester.

Course Structure

The course structure is changing drastically in Spring 2024, moving to a flipped classroom style with mandatory attendance.

Exams

CS421 has three midterms and one final, with the midterms taken in the CBTF. The exams together make up around 70% of the grade in the course.

Homework / MPs

There are weekly MPs or WAs due. About half of the MPs are not for credit, instead questions for the MPs will be taken and used as part of an in-class quiz. You must attend class on quiz days to get credit for these MPs. The Quizes and MPs / WAs make up 30% of the course grade. The midterms and Final exam consists of the questions in MPs that are not asked in the quizzes.

Instructors

The instructor for CS421 is usually Elsa Gunter.

Course Tips

Go to office hours!

Life After

CS 421 is a prerequisite for some other classes like CS426 (Compiler Construction)

Infamous Topics

  • Continuation Passing Style: CPS and CPS transformations can be uncomfortable for students not used to functional programming. Go to office hours!