Building Languages Using Kotlin
summary
Claim: Kotlin plus ANTLR and concise language features let a single engineer build a parser, model, validator, interpreter and a simple editor in about ≈1000 lines of code. Uses ANTLR for lexer/parser, Kotlin data classes and extension functions for mapping and tree validation, ASM for JVM bytecode and a small KLLVM layer for native code. Notes: interpreter is simplest, JVM compiler is 2–3× harder, LLVM about 50% more, and a simulator + editor (with autocomplete/scoping work) materially improves usability.
AI-written summary · about
chapters (26)
- 0:00Introduction
- 0:50Agenda
- 1:52Why should we build languages
- 3:43Domainspecific languages
- 5:20Communication with domain experts
- 6:32Building a generalpurpose language
- 7:58The generalpurpose language
- 8:37The grammar
- 10:09Angular
- 12:06Parser
- 13:16Data Classes
- 15:30Operations Mapping
- 15:48Binary Operations
- 17:47Model
- 19:04InProcess
- 24:55Interpreter
- 27:03Evaluation
- 29:24JVM Compiler
- 30:30Multiplication
- 31:06LLVM Compiler
- 32:05Float Division
- 32:59Summary
- 34:35Editor
- 36:34Simulator
- 37:30Conclusion
- 38:46Conclusions








