Overview
So far, we’ve learned about a variety of programming languages, including Dart, Gleam, and Rust — not forgetting BASIC. We’ve also learned about parsing and interpretation, and about the underlying principles of programming language design.
In this part, we’ll take a peek at some of the steps that happen when a program that has been parsed needs to be compiled into machine code and executed. We’ll also briefly discuss just-in-time compilation and multi-platform support, which are features that are increasingly common in modern programming languages, and discuss WebAssembly as an example of a multi-platform target.
This part is organized as follows:
-
Intermediate Representations introduces the concept of intermediate representations, which are targets that a program can be compiled to before being compiled to machine code.
-
Compiler Optimization Techniques discusses a range of optimizations that can be applied to a program during compilation.
-
Code Generation explains how a compiler can generate machine code from an intermediate representation.
-
Linking, Loading, and Runtime Environment discusses the steps taken after machine code generation that lead to being able to run the program.
-
Just-In-Time Compilation and Multi-Platform Support briefly outlines just-in-time compilation and discusses supporting multiple platforms.
-
Example: WAT and WASM discusses the WebAssembly Text Format and WebAssembly, and briefly demonstrates how to compile a simple Rust program to WebAssembly, loading it into a web application.
Finally, at the end, the chapter Recap and Feedback provides a summary of the part and asks for feedback on the materials.