Overview
In this course, we’ve taken a deep dive into programming language theory and implementation. We’ve explored the design and implementation of programming languages, starting from the basics of syntax and semantics, to more advanced topics such as type systems. At this point, you’re well-equipped with the knowledge and skills to understand how programming languages work under the hood.
In this part, we’ll take a peek at some of the steps that happen when a program 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 and the next part are not meant to be comprehensive overviews of the topics they cover, but rather a brief introduction to some of the key concepts and techniques in these areas. The goal is to give you a taste of these topics and to provide you with resources for further exploration if you’re interested.
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.