Learning how to build languages
Probably you are trying to learn building languages.
I went down that road a number of years ago.
Chances are that you, like me, having been frustrated by:
- Tutorials that are too theoretical: where is the code?
- Outdated resources: I am happy this used to work on a compiler of 20 years ago but it does not compile on my machine
- No big picture: you find some tutorials on parsers and some about compilers, but where are the resources giving you the whole map?
What resources you will find here
So I thought I could help by creating these resources:
- a book: everything is ready for you to learn following a well-organized plan, so that you can focus on the real stuff: building great languages
- a checklist of the 5 most important things to get right when building a language
- a course: if you do not want to buy the book you can follow a series of posts which should help you getting started
- dozens of posts discussing all sorts of topics related to building languages
Whichever path you pick, these resources should help you get started. If you feel something is missing, or you do not know where to start from, feel free to write to [email protected]. I will do my best to help you.
Book: How to create pragmatic, lightweight languages
This book explains how to build languages. The goal here is to end up with something that will be of use in practice. A real language, with an efficient parser and a complete compiler. A language with its own editor. This is not about building toys.
The approach described is based on reusing open-source components, and to organize and combine them to get something real with a limited amount of effort. Do you think it is not possible to build a parser, an interpreter, an editor and a simulator in less than 1.000 lines of code? Think again.
When I was learning how to build languages I was disappointed: I just found some basic tutorials here and there but what was missing was a complete course, organized to lead me from the very beginning to the end. Also, all approaches seemed so theoretical: a lot of words and not enough code.
Checklist: 5 things to get right when building a language
- Interview with Cédric Brun on modeling area
- Interview with Matteo Mortari on process automation
- Interview with Meinte Boersma on Domain-Specific Languages
- Integrating Code Completion in Visual Studio Code – With the Language Server Protocol
- Interview with Scott McKinney on improving static typing
- Code Completion with ANTLR4-c3
- How to write a transpiler
- Getting started with ANTLR: building a simple expression language
- Quick Domain-Specific Languages in Python with textX
- JaRIKo, an RPG Interpreter in Kotlin
- The Great New ANTLR 4.8
- A complete tutorial on the Drools business rule engine
- Create a Transpiler: From VBA to VB.NET
- Blazor: .NET in the Browser
- Getting started with ANTLR in C#
- Understand WebAssembly: Why It Will Change the Web
- The Fun (and Madness) of Esoteric Programming Languages
- Parsing in Java: Tools and Libraries
- The Difference Between a Compiler and an Interpreter
- 68 Resources To Help You To Create Programming Languages
- Language Server Protocol: A Language Server For DOT With Visual Studio Code
- The ANTLR Mega Tutorial
- Why You Should Know the Language Server Protocol
- Interview with Thorsten Ball, author of “Writing an Interpreter in Go”
- Best posts on Language Engineering
- Create a simple parser in C# with Sprache
- The Important Changes in the New ANTLR 4.6
- Kanvas: Generating a Simple IDE From Your ANTLR Grammar
- Interesting things happening in Language Engineering
- Writing a very simple JS editor
- Getting started with Roslyn: transforming C# code
- Generating bytecode
- Building a compiler for your own language: validation
- Building a compiler for your own language: model-to-model transformations
- Building a compiler for your own language: from the parse tree to the Abstract Syntax Tree
- Building autocompletion for an editor based on ANTLR
- How to create an editor with syntax highlighting for your language using ANTLR and Kotlin
- A book on creating languages and supporting tools
- Polyglot Software Development: My PhD Thesis
- Megamodels, projectional editors and Inference in programming