Lectures

Number Date Topic Slides
1 Wednesday, February 2 Course intro Slides
2 Tuesday, February 8 Language models Slides
3 Thursday, February 10 What is a language anyway? Slides
4 Tuesday, February 15 C Slides
hello world: helloworld.c, Makefile
something (swap): something.c
three source files, separately compiled: Makefile, a.h, a.c, b.h, b.c, c.c
5 Thursday, February 17 More C Slides
a string mistake: string_mistake.c
something: something.c and a Makefile
something (separately compiled): something.c, lib.h, lib.c and a Makefile
6 Tuesday, February 22 The Lambda Calculus: syntax Slides
7 Thursday, February 24 The Lambda Calculus: semantics Slides
A program that is the same as (λx.λy.yx)xy
Doing a bigger reduction that has choices (video) and written solution
Using the lambda calculus to understand Python (video)
8 Tuesday, March 1 The Lambda Calculus: surviving Slides
9 Thursday, March 3 LISP Slides
fib.lisp
fizzbuzz.lisp (now go ace those coding interviews 😀)
10 Tuesday, March 8 Higher order functions Slides
my-replace.lisp
length-list.lisp
11 Thursday, March 8 Computability Slides
12 Tuesday, March 15 Midterm Exam Review no slides
13 Thursday, March 17 Midterm Exam no slides
14 Tuesday, April 5 ML Slides
product.fs
product2.fs
15 Thursday, April 7 ML Slides
listOfInts.fs
cartesianProduct.fs
Also, because you've seen map and fold before, but maybe not for F#, here are some examples in a format that should look familiar. See the course textbook for more examples.
16 Tuesday, April 12 Language design Slides
Also see activity handout.
17 Thursday, April 14 Higher-order functions in F# / type inference Slides
Also see fold/pattern matching practice.
Oh, and I did make a really bad video too.
18 Tuesday, April 19 Parsing Slides
19 Thursday, April 21 Building a parser Slides
Program.fs
You'll need to create a dotnet project and download the Parsers.fs library to use it.
Here's a video of the lecture if you want to watch me write this from scratch.
20 Tuesday, April 26 Building an interpreter Slides
Program.fs
Library.fs
You'll need to create a dotnet project and download the Parsers.fs library to use it.
Here's a video of the lecture if you want to watch me write this from scratch.
21 Thursday, April 28 Variables Slides
n/a Saturday, April 30 Minimum Working Example I make a MWE from scratch in this video.. Watch this if you are having trouble wrapping your head around how the pieces fit together.
Note that I also produce SVG output in this example. If your project needs to generate an output file, this is a handy template to follow.
Project files:
CircleLang.fsproj
Program.fs
Library.fs
Basic SVG shapes (mdn documentation)
22 Tuesday, May 3 Scope Slides
Blub language (a simple language with variables):
  Blub.fsproj
  Program.fs
  BlubAST.fs
  BlubParser.fs
  BlubEval.fs
  Some sample Blub programs:
    helloworld.blub
    hellovariable.blub
    hellocomment.blub
    parens.blub
    parens2.blub
    simplemath.blub
    simplemath2.blub
    math.blub
    complex_program.blub
Examples of different scope rules in Perl:
  default.pl (default in Perl-- what scope is this?)
  dynamic_scope.pl
  lexical_scope.pl
  Run perl programs like $ perl default.pl
23 Thursday, May 5 Testing / Object-Oriented Programming Slides
BlubWithTests.zip (a complete .NET project with tests)
Also see .NET Assert documentation for additional test methods.
24 Tuesday, May 10 Package Frameworks / Object-Oriented Programming Slides
An image manipulation program that uses a package from NuGet:
  imagetest.fsproj
  Program.fs
  I installed ImageSharp using the following command: $ dotnet add package SixLabors.ImageSharp --version 2.1.1
A demonstration of object-oriented design using Java:
  Here is a simple example using inheritance to avoid having to reimplement squee in two places.
    Numbers1.java
  Here is another example that shows OO's dramatic savings in effort. We can make a new Rectangle using RationalNumber even though we completely avoided changing the Number, Point, and Rectangle classes.
    Numbers2.java (before)
    Numbers3.java (after)
    If you don't believe me, run: $ diff Numbers2.java Numbers3.java
Here's a video of the lecture if you want to watch me write these things from scratch.
25 Thursday, May 12 C++ / wrap-up Slides
Honkable.cc (what happens in C++ when you don't declare a method virtual)
Honkable2.cc (correctly declared virtual)
  • CSCI 334: Principles of Programming Languages, Spring 2022

CSCI 334 website repository, Spring 2022

Powered by Bootstrap 4 Github Pages