Interpreters

The course designers and instructors deeply appreciate researchers in the community for their inspiring works, which provide rich materials for developing the course and advancing the research in this direction.

Back to Homepage · Previous Page




Welcome to the course on Interpreters and Virtual Machines! This course delves into the fascinating world of how programs are executed in another way, focusing on interpreted execution rather than compiled execution (which should be studied in the course known as Compilers). An interpreter or virtual machine, like the Python interpreter and the Java virtual machine, creates a simulated environment in which programs can run, providing benefits like platform independence and enhanced security. This course will guide you through the architecture of interpreters and virtual machines, including popular examples like the tree-walk interpreter and Java Virtual Machine (JVM).By the end of this course, you’ll have a deep understanding of how interpreters and virtual machines function and how they are used to execute code efficiently and securely. This knowledge is essential for anyone interested in the inner workings of programming languages, software development, or computer architecture.

Prerequisites: Before registering for this course, a student must check if he has basic knowledge of compilers and the C/C++ and Java programming languages.

Lectures

The course slides are provided in the table below. If you have any questions or suggestions, please feel free to reach out to the instructor or teaching assistants. The course designers sincerely thank the instructors and researchers in the community whose inspiring work has contributed valuable material for these slides.

Weeks
Lectures Materials
1
Introduction to Interpreters and Virtual Machines
   - Basic concepts of programming languages, compilers, interpreters, and VM

Slides-1
Tree-Walk Interpreter
2
Generating the Syntax Tree
   - Introduction to the mini Java language
   - Review of the lexical and syntax analysis

Slides-2
Slides-3
3
Expressions and Statements
   - Evaluating expressions / Online type checking
   - Evaluating statements / Scoping and shadowing
   - Lab 1: Hello, my tree-walk interpreter!

Slides-4
Slides-5
Lab-1
4
Control Flows and Methods
   - Conditional execution / Loops
   - Method declaration / Method invocation / Method return

Slides-6
Slides-7
5
Object-Oriented Programming
   - Arrays
   - Classes
   - Lab 2: Enhancing the tree-walk interpreter.

Slides-8
Slides-9
Lab-2
6
Inheritance and Polymorphism
   - Super- and sub- classes
   - Invoking virtual functions

Slides-10
Slides-11
Java Virtual Machine
7
Introduction to Java Virtual Machine
   - Java bytecode / Basic structure of OpenJDK
   - The First Attempt of Hacking JVM

Slides-12
Slides-13
8
Object Model and Class Loader
   - Object and class representation in JVM
   - Loading, initializing, using, and unloading classes

Slides-14
Slides-15
9
Template Interpreter
   - Architecture of the interpreter / machine code template
   - Code cache / interpreter generation
   - Lab 3: Enriching the Java bytecode instruction set.

Slides-16
Slides-17
Lab-3
10
Memory Management
   - VM memory structure / Runtime space allocation
   - Garbage collection and its optimization

Slides-18
Slides-19
11
Dealing with Exceptions
   - Context of exceptions / local and remote exceptions
   - Stack trace / Control transference

Slides-20
Slides-21
12
Linker and Native Interfaces
   - Verification, preparation, and resolution / Linking methods
   - JNI / Communications between Java and JVM
   - Lab 4: Reshaping the Java native interfaces.

Slides-22
Slides-23
Lab-4
13
Threading Model
   - Mapping VM threads to OS threads / Synchronization components / GC support
   - Optimizing synchronization / Transactions

Slides-24
Slides-25
14
Just-in-Time Compilation – I
   - Bytecode → High-level IR (HIR) → Low-level IR (LIR)
   - HIR and LIR optimizations

Slides-26
Slides-27
15
Just-in-Time Compilation – II
   - Sea-of-node IR and optimizations
   - GC support and deoptimizations
   - Lab 5: One more optimization for JVM!

Slides-28
Slides-29
Lab-5
Conclusion
16
Concluding the Course
   - Review of the lectures and the labs

Slides-30

Grading Scheme

Labs (50%) + Exam (50%)

Teaching Assistants

(TBA)

Online Discussion

(TBA)

Office Hours

By appointment. Feel free to email TAs or the instructors to claim a time slot.