Skip to main content
CF

Building a Transpiler from scratch

2h 3s
English
Paid

Building a Transpiler from scratch is a 18-lesson 2 hours self-paced course by Dmitry Soshnikov. In modern implementations of compilers, it has become popular to transform one high-level language into another.

Course facts

Lessons
18
Duration
2 hours
Level
All levels
Language
English
Updated
Instructor
Dmitry Soshnikov
Price
Premium

In modern implementations of compilers, it has become popular to transform one high-level language into another. Examples include transpiling new versions of JavaScript into older ones or converting TypeScript into JavaScript. Such compilers are called transpilers, and this course is dedicated to them.

Why are transpilers important?

Transpilers allow the use of existing runtime environments (such as JavaScript engines) while avoiding dealing with low-level details such as memory management or bytecode. This is a practical and efficient approach to learning compilers, especially if you want to create your own programming language.

Unlike traditional books on compilers that focus on theoretical aspects (grammars, parsing, etc.), this course offers a practical guide to creating a full-fledged transpiler in 2-4 hours. We will develop it in a live coding format, step by step, with clear explanations.

What will you learn?

We will focus on transpiling a high-level concurrent programming language with message-passing processes into JavaScript. Besides transpiling, you will understand how concurrent functional languages (such as Erlang) and even operating systems with processes and threads work.

Developing a transpiler will improve your programming skills as it involves data structures, algorithms, and architectural decisions.

Course prerequisites

It is optionally recommended to take the course "Building an Interpreter from Scratch", where we create an AST interpreter. If you already understand concepts such as eval, closures, scopes, environments, you can start this course directly.

Who is this course for?

  • For engineers who want to master the creation of complex systems and acquire transferable knowledge
  • For those interested in compilers, programming languages, and type theory
  • For developers who want to create their own programming language

What technologies are used?

We will write the transpiler in JavaScript and compile code into JavaScript. This choice makes the course accessible to a wide range of developers and allows the code to be adapted to other languages (TypeScript, Rust, OCaml, C++, Python, etc.).

Important! This course is focused on active learning. We do not just provide the final code - you will need to implement key parts of the transpiler yourself in specially prepared exercises.

Course format

  • Clear and structured lectures - without distractions and unnecessary theoretical digressions
  • Animated presentations + live notes - to visually explain complex topics
  • Live coding with step-by-step assignments - from an empty project to a full-fledged transpiler

Additional

https://github.com/DmitrySoshnikov/eva-mpp-source

Who teaches Building a Transpiler from scratch? Dmitry Soshnikov

Dmitry Soshnikov thumbnail

Dmitry Soshnikov is a Russian software engineer and educator focused on programming-language internals, compiler construction, JavaScript engine architecture, and the theoretical computer-science foundations underneath modern software development. His independent course catalog is one of the deepest sources of long-form material on language implementation available outside university CS programs.

His CourseFlix listing carries nine courses spanning parser combinators, interpreter construction, garbage-collection algorithm internals, the design of pattern-matching engines, and JavaScript object-model deep dives. Material is paid and aimed at engineers who want to understand how the languages they use every day actually work under the hood.

What lessons are included in Building a Transpiler from scratch?

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 18 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Lecture 1: Transpiler overview | Numbers
All Course Lessons (18)
#Lesson TitleDurationAccess
1
Lecture 1: Transpiler overview | Numbers Demo
12:04
2
Lecture 2: Strings | Blocks and Statements
07:28
3
Lecture 3: Parsing: S-expression to AST
05:59
4
Lecture 4: Variable declaration and lookup
05:17
5
Lecture 5: Function calls | Runtime
04:21
6
Lecture 6: Binary and Unary expressions
05:29
7
Lecture 7: Control flow: If statement | While loops
03:12
8
Lecture 8: Function declarations | Return statement
05:14
9
Lecture 9: Primer on generators
08:40
10
Lecture 10: Process | Scheduler class
05:08
11
Lecture 11: Spawning processes | JS Transform
07:48
12
Lecture 12: Records and Lists
07:00
13
Lecture 13: Pattern matching | Decomposition
11:42
14
Lecture 14: Pattern matching statement
05:23
15
Lecture 15: Awaiting messages | Process mailbox
05:41
16
Lecture 16: Receive statement | Recursive calls
05:18
17
Lecture 17: Using compiled code from Web
08:35
18
Lecture 18: Final executable | Next steps
05:44
Unlock unlimited learning

Get instant access to all 17 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

What courses are similar to Building a Transpiler from scratch?

  • Programming Language with LLVM thumbnailUpdated 1y ago

    Programming Language with LLVM

    By: Dmitry Soshnikov
    Programming Language with LLVM — implement a compiler that emits native code via LLVM IR. Master codegen, optimisation passes, and JIT.
    2h 46m5/5
  • Write a Compiler thumbnailUpdated 2mo ago

    Write a Compiler

    By: David Beazley
    Unlock the Complexity of Software Development by Writing a Compiler . The course on compiler development is traditionally considered a capstone discipline.
    35h 41m
  • Automata Theory: inside a RegExp machine thumbnailUpdated 1y ago

    Automata Theory: inside a RegExp machine

    By: Dmitry Soshnikov
    State machines — the fundamental concept used today in many practical applications, starting from UI programming like React, automated reply systems, lexical an
    1h 48m5/5

Frequently asked questions

What prerequisites are needed before enrolling in this course?
A foundational understanding of programming languages and familiarity with JavaScript is recommended. The course involves concepts like parsing and ASTs, which assume knowledge of programming language structures. Familiarity with JavaScript’s runtime environment will also be beneficial, as the course includes lessons on JS Transform and using compiled code from the web.
What projects or exercises will I work on during the course?
Throughout the course, you'll have the chance to work on building a transpiler that transforms one high-level language into another. This includes parsing S-expressions into ASTs, handling variable declarations, and implementing control flow constructs like If statements and While loops. The final project involves creating a complete executable from the transpiled code.
Who is the target audience for this course?
This course is designed for intermediate to advanced programmers interested in compilers and language transformation processes. It is particularly suitable for those who have a keen interest in learning how modern transpilers work, especially in the context of JavaScript and TypeScript.
How does the depth and scope of this course compare to similar courses?
This course offers a focused exploration of transpilers, covering topics from parsing S-expressions to generating final executable code. Unlike broader compiler courses, this course emphasizes transforming high-level languages, making it ideal for learners specifically interested in the mechanics of transpiling languages like JavaScript.
What specific tools or platforms are covered in the course?
The course covers several specific components, such as the JS Transform for JavaScript, and the use of a Scheduler class for handling processes. Lessons also delve into parsing techniques and runtime environments, which are essential for implementing and understanding transpilers.
What topics are not covered in this course?
The course does not cover traditional compiler construction topics like machine code generation or low-level optimizations. It focuses exclusively on high-level language transformation, specifically targeting JavaScript and related technologies, rather than general compiler design.
What is the estimated time commitment for completing this course?
The course comprises 18 lessons, and while the total runtime is not specified, the depth of topics such as parsing, pattern matching, and process handling suggests a significant time investment. Prospective students should be prepared to dedicate several weeks to fully grasp and implement the concepts taught.