Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
run: |
curl -Ls https://github.com/jgm/pandoc/releases/download/2.11.2/pandoc-2.11.2-1-amd64.deb -o pandoc.deb
sudo dpkg -i pandoc.deb
sudo apt-get install nasm
sudo apt-get install fonts-stix
sudo apt-get install libunistring-dev
- name: Install Racket
Expand All @@ -39,9 +38,9 @@ jobs:
version: '8.18'
- name: Install a86, langs, and assignments
run: |
git clone https://github.com/cmsc430/a86.git
git clone https://github.com/cmsc430/langs.git
git clone https://github.com/cmsc430/assignments.git
git clone --branch "${{ github.ref_name }}" --single-branch https://github.com/cmsc430/a86.git
git clone --branch "${{ github.ref_name }}" --single-branch https://github.com/cmsc430/langs.git
git clone --branch "${{ github.ref_name }}" --single-branch https://github.com/cmsc430/assignments.git
raco pkg install --auto a86/
raco pkg install --auto langs/
raco pkg install --auto assignments/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ University of Maryland, College Park.

The current instance of this course is:

* http://www.cs.umd.edu/class/fall2025/cmsc430/
* http://www.cs.umd.edu/class/summer2026/cmsc430/

Copyright © David Van Horn and José Manuel Calderón Trilla and Leonidas Lampropoulos

Expand Down
2 changes: 1 addition & 1 deletion www/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ scribble:
$(course).scrbl

push:
rsync -rvzp main/ dvanhorn@junkfood.cs.umd.edu:/fs/www/class/fall2025/cmsc430/
rsync -rvzp main/ dvanhorn@junkfood.cs.umd.edu:/fs/www/class/summer2026/cmsc430/

clean:
rm -rf $(course)
3 changes: 2 additions & 1 deletion www/assignments/5.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

@(require (for-label a86/ast (except-in racket ...)))

@(ev '(require fraud-plus))
@(ev '(require fraud-plus fraud-plus/compiler/compile fraud-plus/executor/run))
@(ev '(define (exec e) (run (compile e))))

@bold{Due: @assign-deadline[5]}

Expand Down
2 changes: 1 addition & 1 deletion www/assignments/8.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ respective pattern.
[(vector (vector x) (vector 2)) x])
]

@section[#:tag-prefix "a8-" #:style 'unnumbered #:tag "vector"]{Predicate patterns}
@section[#:tag-prefix "a8-" #:style 'unnumbered #:tag "predicate"]{Predicate patterns}

The @racket[(? _f)] pattern matches any value for which the predicate
@racket[_f] returns a true value (any value other than @racket[#f])
Expand Down
4 changes: 1 addition & 3 deletions www/colophon.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ System information:
@itemlist[
(i "uname -srm")
(i "racket --version")
(i "raco pkg show -lu a86 langs")
(i "nasm --version")
(i "gcc --version")]
(i "raco pkg show -lu a86 langs")]
76 changes: 25 additions & 51 deletions www/defns.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -12,79 +12,53 @@
(define prof1-email "dvanhorn@cs.umd.edu")
(define prof1-initials "DVH")

(define semester "fall")
(define year "2025")
(define semester "summer")
(define year "2026")
(define courseno "CMSC 430")

(define lecture-dates "" #;"May 30 -- July 7, 2023")
(define lecture-dates "June 1 -- July 10, 2026")

(define IRB "IRB")
(define AVW "AVW")
(define KEY "KEY")

(define office-hour-location (elem AVW " " "4122"))
(define office-hour-location "TBD")

(define start-date "September 2")
(define m1-date "October 16")
(define m2-date "November 13")
(define start-date "June 1")
(define m1-date "June 16")
(define m2-date "July 1")
(define midterm-hours "24")
(define final-date "December 18")
(define final-end-time "12:30pm")
(define elms-url "https://umd.instructure.com/courses/1388468")
(define final-date "July 10")
(define final-end-time "11:59pm")
(define elms-url "https://umd.instructure.com/courses/1406982")


(define racket-version "8.18")

(define staff
(list (list "Pierce Darragh" "pdarragh@umd.edu")
(list "Benjamin Quiring" "bquiring@umd.edu")
(list "Kalyan Bhetwal" "bhetwal@umd.edu")
(list "Abhi Senthilkumar" "asenthil@terpmail.umd.edu")
(list "Zhongqi Wang" "zqwang@umd.edu")
(list "Kazi Tasnim Zinat" "kzintas@umd.edu")))
(list (list "Pierce Darragh" "pdarragh@umd.edu")))

(define lecture-schedule1 "TTh, 2:00-3:15pm")
(define lecture-schedule1 "Weekdays, 10:00-11:15am")

(define classroom1 "LEF 2205")
(define classroom1
(link "https://umd.zoom.us/j/96210969737?pwd=K6Iz8IZNchyWEcV3UERCi6KPkawRDw.1" "Online"))

;(define discord "TBD")
(define piazza "https://piazza.com/umd/fall2025/cmsc430/home")
(define gradescope "https://www.gradescope.com/courses/1098215/")
(define piazza "https://piazza.com/umd/summer2026/cmsc430/home")
(define gradescope "https://www.gradescope.com/")

(define feedback "https://forms.gle/99yTz7HVfopCaDMz9")

(define (assign-deadline i)
(list-ref '("Thursday, September 11, 11:59PM"
"Thursday, September 18, 11:59PM"
"Thursday, September 25, 11:59PM"
"Thursday, October 2, 11:59PM"
"Thursday, October 23, 11:59PM"
"Tuesday, November 4, 11:59PM"
"Tuesday, November 11, 11:59PM"
"Tuesday, December 9, 11:59PM"
#;"Thursday, December 4, 11:59PM")
(list-ref '("Thursday, June 4, 11:59PM"
"Friday, June 5, 11:59PM"
"Friday, June 12, 11:59PM"
"Monday, June 22, 11:59PM"
"Monday, June 29, 11:59PM"
"Monday, July 6, 11:59PM"
"Wednesday, July 8, 11:59PM"
"Thursday, July 9, 11:59PM")
(sub1 i)))

(define office-hours
(itemlist
#:style 'compact
(item "Monday"
(itemlist
(item "9:00am–12:00pm — Zhonqi")
(item "12:00pm–3:00pm — Ben")
(item "3:00pm–6:00pm — Abhi")))
(item "Tuesday"
(itemlist
(item "11:00am–2:00pm — Abhi")))
(item "Wednesday"
(itemlist
(item "9:00am–12:00pm — Zhonqi")
(item "12:00pm–3:00pm — Ben")
(item "3:30pm–6:30pm — Kalyan")))
(item "Thursday"
(itemlist
(item "10:00am–1:00pm — Zinat")))
(item "Friday"
(itemlist
(item "11:00am–2:00pm — Zinat")
(item "4:00pm–7:00pm — Kalyan")))))
"TBD")
4 changes: 2 additions & 2 deletions www/notes.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ These are the course notes for CMSC 430. They can be a bit
rough around the edges in places, but please keep in mind
this is a @emph{living} document. If you spot errors,
confusing prose, missing parts, or generally have
suggestions for improving the material, @bold{please},
@bold{please}, @bold{please} submit an
suggestions for improving the material, submit an
@link["https://github.com/cmsc430/www"]{issue on Github}.

@local-table-of-contents[#:style 'immediate-only]
Expand Down Expand Up @@ -36,3 +35,4 @@ suggestions for improving the material, @bold{please},
@include-section{notes/neerdowell.scrbl}
@include-section{notes/outlaw.scrbl}
@;include-section{notes/shakedown.scrbl}
@index-section[]
37 changes: 23 additions & 14 deletions www/notes/1/what-is-a-compiler.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ characterize a language in a theory of computation course. If we
wanted to rigorously define this set, we could provide a formal
recognizer such as a finite automaton or even a Turing-machine that
given a string, determines membership in the set of programs. This
aspect of a language we call its @bold{syntax}: it concerns the rules
governing the formation of phrases in the language. While important,
syntax is not the end-all of a programming language, in fact it really
just the start of where the rubber meets the road. For example, when
writing a C program we mostly don't care about whether the thing we
are writing is or is not in the set of C programs --- it being a C
program is a prerequisite to thing we want to do, which is to
@emph{compute}. We write programs so that we run them. Sure, you
might make a syntax error, forget to put a semicolon here or mispell
an identifier there, but the thing you really care about comes after
those issues have been resolved. So another aspect of what a
aspect of a language we call its @index["syntax"]{@bold{syntax}}: it
concerns the rules governing the formation of phrases in the language.
While important, syntax is not the end-all of a programming language,
in fact it really just the start of where the rubber meets the road.
For example, when writing a C program we mostly don't care about
whether the thing we are writing is or is not in the set of C programs
--- it being a C program is a prerequisite to thing we want to do,
which is to @emph{compute}. We write programs so that we run them.
Sure, you might make a syntax error, forget to put a semicolon here or
mispell an identifier there, but the thing you really care about comes
after those issues have been resolved. So another aspect of what a
programming language "is" concerns the @emph{meaning} of the sentences
in that language. Every language has meaning. In the context of
programming language, the meaning is a computation. This aspect of a
langauge we its @bold{semantics}: it concerns the computational
content of programs in the language.
langauge we call its @index["semantics"]{@bold{semantics}}: it
concerns the computational content of programs in the language.

There are many ways we might define the meaning of a program, and
therby define the semantics of the language. We could give examples,
Expand All @@ -77,6 +77,15 @@ could write a program (perhaps in a different language) that
@emph{interprets} expressions and computes their meaning. Typically
some combination of all of these approaches are used.

Putting it all together, we can concisely define a programming
language as follows:

@inset-flow{
A programming language is a formal language for expressing
computations, with rules for what programs look like (syntax), and
rules for what those programs mean or do when run (semantics).}


But all of this @emph{defines} what a programming language is, which
is not the same as @emph{realizing} that definition. For that we need
to implement the language, meaning we need to construct a universal
Expand Down Expand Up @@ -227,7 +236,7 @@ descendent of the Scheme programming language, and a close cousin of
OCaml, which you've previously studied. This is largely an arbitrary
choice. We could have picked any programming language to build a
compiler for. In choosing Racket, we get a mature, well-designed
language with a minimal, easy to parse semantics and a well-understood
language with a minimal, easy to parse syntax and a well-understood
and clear semantics that has features representative of many modern
high-level programming languages such as OCaml, Java, Python,
JavaScript, Haskell, etc. If you can write a compiler for Racket, you
Expand Down
2 changes: 1 addition & 1 deletion www/notes/a86.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -437,4 +437,4 @@ comes time to test the compilers we write.

There is more to a86, which you can find documented in the
@secref["a86_Reference"], although we try to introduce features of a86
as we encounter them.
as we encounter them.
42 changes: 21 additions & 21 deletions www/notes/abscond.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

@(define codeblock-include (make-codeblock-include #'here))

@(ev '(require rackunit a86 abscond abscond/correct))
@(ev '(require rackunit a86 abscond abscond/correct abscond/compiler/compile abscond/executor/run))
@(ev '(define (exec-expr e) (run (compile e))))

@(define (shellbox . s)
(parameterize ([current-directory (build-path langs "abscond")])
Expand Down Expand Up @@ -162,13 +163,13 @@ For each category, we will have an appropriate constructor. In the case of Absc
all expressions are integers, so we have a single constructor, @racket[Lit].
A datatype for representing expressions can be defined as:

@codeblock-include["abscond/ast.rkt"]
@codeblock-include["abscond/syntax/ast.rkt"]


The parser for Abscond checks that a given s-expression is
an integer and constructs an instance of the AST datatype if
it is, otherwise it signals an error:
@codeblock-include["abscond/parse.rkt"]
@codeblock-include["abscond/syntax/parse.rkt"]

@ex[
(parse 5)
Expand All @@ -184,7 +185,7 @@ The meaning of an Abscond program is simply the number itself. So
We can write an ``interpreter'' that consumes an expression and
produces it's meaning:

@codeblock-include["abscond/interp.rkt"]
@codeblock-include["abscond/interpreter/interp.rkt"]

@#reader scribble/comment-reader
(examples #:eval ev
Expand All @@ -203,7 +204,7 @@ but this will change as the langauge grows.
We can add a command line wrapper program for interpreting Abscond
programs from stdin:

@codeblock-include["abscond/interp-stdin.rkt"]
@codeblock-include["abscond/interpreter/interp-stdin.rkt"]

The details here aren't important (and you won't be asked to write
this kind of code), but this program @racket[read]s the contents of a
Expand Down Expand Up @@ -310,14 +311,14 @@ So our compiler will emit x86 assembly code. To make our lives a bit
easier, we will write the run-time system in C. Let's start with the
Abscond runtime:

@filebox-include[fancy-c abscond "main.c"]
@filebox-include[fancy-c abscond "runtime/main.c"]

This C program provides the main entry point for running an Abscond
program. It relies upon a function @tt{print_result} which is defined
as follows:

@filebox-include[fancy-c abscond "print.h"]
@filebox-include[fancy-c abscond "print.c"]
@filebox-include[fancy-c abscond "runtime/print.h"]
@filebox-include[fancy-c abscond "runtime/print.c"]

Separating out @tt{print_result}, which at this point is just a simple
@tt{printf} statement, seems like overkill, but it will be useful in
Expand Down Expand Up @@ -433,7 +434,7 @@ So the AST representation of our example is:

Writing the @racket[compile] function is easy:

@codeblock-include["abscond/compile.rkt"]
@codeblock-include["abscond/compiler/compile.rkt"]

@#reader scribble/comment-reader
(examples #:eval ev
Expand All @@ -456,7 +457,7 @@ Putting it all together, we can write a command line compiler much
like the command line interpreter before, except now we emit assembly
code:

@codeblock-include["abscond/compile-stdin.rkt"]
@codeblock-include["abscond/compiler/compile-stdin.rkt"]

Example:

Expand Down Expand Up @@ -518,15 +519,16 @@ What does that even mean, to be correct?

First, let's formulate an alternative implementation of
@racket[interp] that composes our compiler and a86 interpreter to define
a (hopefully!) equivalent function to @racket[interp]:
a lower-level execution wrapper for assembled programs:

@codeblock-include["abscond/exec.rkt"]
@codeblock-include["abscond/executor/exec.rkt"]

This function can be used as a drop-in replacement to @racket[interp]:
For source expressions, we can recover the old behavior by composing
@racket[compile] with @racket[run]:

@ex[
(exec (Lit 42))
(exec (Lit 19))]
(exec-expr (Lit 42))
(exec-expr (Lit 19))]

It captures the idea of a phase-distinction in that you can first
compile a program into a program in another language---in this case
Expand All @@ -535,7 +537,7 @@ If the compiler is correct, the result should be the same:

@bold{Compiler Correctness}: @emph{For all @racket[e] @math{∈}
@tt{Expr} and @racket[i] @math{∈} @tt{Integer}, if @racket[(interp e)]
equals @racket[i], then @racket[(exec e)] equals
equals @racket[i], then @racket[(exec-expr e)] equals
@racket[i].}

One thing that is nice about specifying our language with an
Expand All @@ -549,9 +551,9 @@ compilation within Racket:


@ex[
(exec (Lit 42))
(exec (Lit 37))
(exec (Lit -8))]
(exec-expr (Lit 42))
(exec-expr (Lit 37))
(exec-expr (Lit -8))]

This of course agrees with what we will get from the interpreter:

Expand Down Expand Up @@ -605,5 +607,3 @@ of a valid input (i.e. some integer) that might refute the correctness
claim?

Think on it. In the meantime, let's move on.


Loading
Loading