Langium
Langium is a framework for building language tools, such as editors, linters, and compilers, using TypeScript or JavaScript. It’s particularly useful for creating domain-specific languages (DSLs) or extending existing languages. Langium leverages the Language Server Protocol (LSP) to provide features like syntax highlighting, code completion, and error checking in modern code editors like VS Code.
Course Getting started with ‘Langium’
-
Youtube list of the course Getting started with ‘Langium’
-
MiniLogo GitHub Repo: TypeFox/langium-minilogo
-
The written tutorial Minilogo tutorial
-
My repo ULL-ESIT-PL/learning-langium used to take the course
-
Reference document for the Langium Grammar Language
TypeScript and Node.js
For the usage of TypeScript with node.js See
Other References
- Irina Artemeva on ‘Build Your Language With Langium - Run It Anywhere’
- Langium + AI: Building AI Applications for DSLs - Benjamin F. Wilson in langdev 2024 conference
- Master thesis Implementing Structural Search and Replace for Showcasing ECMAScript Language Proposals by Rolf Martin Glomsrud
Langium Simple Example: Creating a Basic DSL
See Langium Simple Example: Creating a Basic DSL
Chevrotain
The Langium parser is created using Chevrotain which is LL(k) and has a built-in lexer based on Javascript Regular Expressions. Langium also allows the use of Extended Backus-Naur Form (EBNF) Expressions for terminals, but we highly recommend that you write your terminals using Regular Expressions instead.