Study Learn Grow
Building An Interpreter From Scratch

Building An Interpreter From Scratch


This class is for any curious engineer, who would like to gain skills in building complex systems (and building a programming language is really a pretty advanced engineering task!), and obtain transferable knowledge for building such systems.

Overview

Description
Course Overview

How do programming languages work under the hood? What’s the difference between compiler and interpreter? What is a virtual machine, and JIT-compiler? And what about the difference between functional and imperative programming?

There are so many questions when it comes to implementing a programming language!

The problem with “compiler classes” in school is they usually are presented as some “hardcore rocket science” which is only for advanced engineers.

Moreover, classic compiler books start from the least significant topic, such as Lexical analysis, going right away deep down to the theoretical aspects of formal grammars. And by the time of implementing a first Tokenizer module, students simply lose interest in the topic, not having a chance to actually start implementing a programing language itself. And all this is spread to a whole semester of messing with tokenizers and BNF grammars, without understanding the actual semantics of programming languages.

I believe we should be able to build and understand a full programming language semantics, end-to-end, in 4-6 hours — with content going straight to the point, showed in live coding sessions as pair-programming, and described in a comprehensible way.

In the Essentials of Interpretations class, we focus specifically on runtime semantics and build an interpreter for a programming language very similar to JavaScript or Python.

Implementing a programing language would also make your practical usage level of other programming languages more professional.

Who this class is for?

This class is for any curious engineer, who would like to gain skills in building complex systems (and building a programming language is really a pretty advanced engineering task!), and obtain transferable knowledge for building such systems.
If you are interested specifically in compilers, interpreters, and source code transformation tools, then this class is also for you.
The only pre-requisite for this class is basic data structures and algorithms: trees, lists, traversal.
What is used for implementation?

Since we build a language very similar in semantics to JavaScript or Python (the two most popular programming languages today) we use specifically JavaScript — its elegant multi-paradigm structure which combines functional programming, class-based, and prototype-based OOP fits ideal for that.

Many engineers are familiar with JavaScript so it should be easier to start coding right away. However in implementation, we don’t rely on too specific JS constructs, and the code from the course should be easily portable to TypeScript, Python, Java, C++, Rust, and any other language of your taste.

Note: we want our students to actually follow, understand and implement every detail of the interpreter themselves, instead of just copy-pasting from the final solution. The full source code for the language is available in video lectures, showing and guiding how to structure specific modules.

What's specific in this class?

The main features of these lectures are:

Concise and straight to the point. Each lecture is self-sufficient, concise, and describes information directly related to the topic, not distracting on unrelated materials or talks.

Animated presentation combined with live-editing notes. This makes an understanding of the topics easier and shows how (and when at the time) the object structures are connected. Static slides simply don’t work for complex content.

Live coding session end-to-end with assignments. The full source code, starting from scratch, and up to the very end is presented in the class

What is in the course?

The course is divided into four parts, in a total of 18 lectures, and many sub-topics in each lecture.

Part 1: Compilers crash course

In this part, we describe different compilation and interpretation pipelines, see the difference between JIT-compilers and AOT-compilers, talk about what is a Virtual machine and Bytecode-interpreter, and how it differs from an AST-interpreter, show examples of native code, and LLVM IR, and other topics.
Part 2: Interpreters: Basic expressions and Variables

In this part, we start building our programming language and consider basic expressions, such as numbers, strings, talk about variables, scopes, and lexical environments, control structures, and touching parser generator.
Part 3: Functions and Functional programming

In this part, we start talking and implementing function abstraction, and function calls. We describe the concept of closures, lambda function, and IILEs (Immediately-invoked lambda expressions). In addition, we touch on topics of Call-stack, recursion, and syntactic sugar.
Part 4: Object-oriented programming

The final part of the course is devoted to the object-oriented support in our language. We describe the class-based, and prototype-based approaches, implement concepts of classes, instances, and modules.
I hope you’ll enjoy the class, and will be glad to discuss any questions and suggestions in the comments.

- Dmitry Soshnikov

Basic knowledge
Basic data structures and algorithms
Graphs, trees, traversal

Course Information

Basic data structures and algorithms
Graphs, trees, traversal

Build a programing language from scratch
Interpreters and Compilers
AOT, JIT-compilers and Transpilers
AST-interpreters and Virtual Machines
Bytecode, LLVM, Stack-machines
First-class functions, Lambdas and Closures
Call-stack and Activation Records
OOP: Classes, Instances and Prototypes
Modules and Abstractions

This class is for any curious engineer, who would like to gain skills in building complex systems (and building a programming language is really a pretty advanced engineering task!), and obtain transferable knowledge for building such systems.
If you are interested specifically in compilers, interpreters, and source code transformation tools, then this class is also for you.
The only pre-requisite for this class is basic data structures and algorithms: trees, lists, traversal.

• Lifetime Access to Each Course
• Certificate on Completion of Course
• No Extra Charges Or Admin Fees
• Easy Access to Courses
• High Priority Support After Sales.
• Big Discounts on Individual Courses

Course Specifications

Plan your future in engineering with courses including MSc Engineering Management.

See All Courses

Adult education is the non-credential activity of gaining skills and improved education. 

See All Courses

Online education is electronically supported learning that relies on the Internet for teacher/student interaction. 

See All Courses

A short course is a learning programme that gives you combined content or specific skills training in a short period of time. Short courses often lean towards the more practical side of things and have less theory than a university course – this gives you a more hands-on experience within your field of interest.

See All Courses

Course duration is 24 hours.

See All Courses

Study Learn Grow

Related Jobs