Each chapter refers to what files and directories are used for the
topic. All code resides in directory plcFSharp.
For instance, the chapter on micro-SML refers to the subdirectories
MicroVM and MicroSML found in plcFSharp. This means that all
exampels and exercises can be completed by having those two
directories available in a folder, e.g.,
.../ExerciseMicroSML/MicroVM
/MicroSML
You can also make code changes directly in the cloned repository. We recommend you copy the needed folders such that you do not need to implement all exercises in the same set of files.
The table below should what directories contain example code used in each chapter.
| Chapter | Title | Example Code |
|---|---|---|
| 1 | Introduction | Intro |
| 2 | Interpreters and Compilers | Intcomp |
| 3 | From Concrete Syntax to Abstract Syntax | Usql, SExpr, Expr |
| 4 | A First-Order Functional Language | Fun, TypedFun |
| 5 | Higher-Order Functions | Fun |
| 6 | Polymorphic Types | Fun |
| 7 | Imperative Languages | Imp, MicroC |
| 8 | Compiling Micro-C | MicroC |
| 9 | Real-World Abstract Machines | Virtual |
| 10 | Garbage Collection | ListC, MicroVM |
| 11 | Continuations | Cont |
| 12 | A Locally Optimizing Compiler | MicroC |
| 13 | Compiling Micro-SML | MicroSML, MicroVM |
| 14 | Typing Micro-Java | MicroJ |
| 15 | Compiling Micro-Java | MicroJ, MicroVM |
| 16 | Real Machine Code: Arm64 | Arm64 |
| App. A | Crash Course in F# | Intro |
The supporting files work on Linux, MacOS and Windows platforms.
You need the following installed:
-
.NET SDK, version 8+, see Install .NET on Windows, Linux, and macOS
-
Java SE 25+ compiler, Linux, macOS, Windows.
-
Clang and LLVM, a cross platform compiler supporting C and C++. The Clang compiler is a cross platform compiler and works on Linux, MacOS and Windows.
One approach is to install using a package manager:
- Debian:
sudo apt install clang
The provided code has also been tested with default gcc compiler on
various Linux distributions.
Clang is the default compiler on MacOS. No need for further
installation. You can also compile with gcc which is likely an alias
for clang.
There are two dependencies that must be installed:
Find Build Tools for Visual Studio 2026, download the installer, and use it to select and install this workload:
- Desktop development with C++
clangfor Windows x86_64, llvm
LLVM-22.1.0-win64.exe(or later)
Consult MicroVM/README.md to test the installation on the micro
virtual machine, microvm.c.
You may check version and any later version should work:
$ clang --version
clang version 22.1.0 (https://github.com/llvm/llvm-project 4434dabb69916856b824f68a64b029c67175e532)
Target: x86_64-pc-windows-msvcInstall MSYS2, which is a Unix-style environment for building native Windows programs. Then you can build the provided C code and Arm64 assembly examples exactly as described for Linux in other READMEs.
Go to https://www.msys2.org/, download the installer called something
like msys2-arm64-yyyymmdd.exe and run it. This will install MSYS2
in directory C:\msys64.
Run C:\msys64\clangarm64.exe which opens a Linux-style command line
prompt.
Update the msys2 package list using the pacman package manager in msys2:
$ pacman -SuyInstall clang tools and so on:
$ pacman -S mingw-w64-clang-aarch64-clangConsult MicroVM/README.md to test the installation on the micro
virtual machine, microvm.c.