Built to bring language engineering to the next level _

Langium is an open source language engineering tool with first-class support for the Language Server Protocol, written in TypeScript and running in Node.js.

This future-proof technology stack enables domain-specific languages
in VS Code, Eclipse Theia, web applications, and more.

Why Langium?

_ TypeScript integration

Langium generates a typed abstract syntax tree (AST) definition that perfectly fits your grammar and provides utility functions to help you navigate and process the AST.

_ Quality based on experience

Langium was developed on the basis of years of practical use of Xtext, which is an integral part of numerous projects and products worldwide. We apply this experience to push language engineering to a new level.

_ Low barrier to entry

The main goal of Langium is to lower the barrier of creating a DSL or low-code platform. We achieve this by providing a special DSL that describes the syntax and structure of your language: the grammar language.

_ Your language, everywhere

Built exclusively on web technologies, Langium is not only available for Node.js based environments but works just as well in your browser. When packaged as a language server, you can connect it to most modern IDEs.

_ Lean by default, customizable by design

Exploiting the power of the Language Server Protocol, Langium provides useful default implementations for most features. If you are in need of something special, you can override the defaults with your custom implementation.

_ Versatile use

You can easily package a Langium-based DSL as a command line interface (CLI) to create a rich set of interconnected tools: validator, interpreter, code generators, service adapters, etc.

Features

_ Simple and direct integration

.... with the VS Code extension API

_ Well-known technology stack

.... implemented in TypeScript, runs in Node.js

_ Proven quality on a next level

.... with a grammar declaration language similar to Xtext

_ Declarative approach

.... derives a parser and abstract syntax tree from a grammar declaration

_ High performance

... by using Chevrotain—the blazing fast parser library—under the hood

_ Scale it

.... with high out-of-the-box functionality and high extensibility

Langium vs. Xtext

Despite its age, Xtext is still an excellent basis for building languages and related tools with a Java technology stack. In recent years, however, the VS Code extension API has become increasingly relevant, not only for VS Code itself, but also for other tools that support this format, such as Eclipse Theia.

This is why Langium has been created. It enables language engineering in TypeScript, the same technology used for VS code extensions.

The differences at a glance:

_ Langium is clear

Building a tool that uses an Xtext-based language server with VS Code or Theia means creating a hybrid technology stack where some parts are implemented in Java and others in TypeScript. Developing and maintaining such a mixed code base is more challenging for the engineers involved, and long-term maintenance is more difficult compared to Langium's coherent technology stack.

_ Langium is simple

Xtext is heavily based on the Eclipse Modeling Framework (EMF). This can be an advantage if you want to integrate with other Eclipse modeling tools (e.g. Sirius), but it can also be a burden due to its complexity. Langium uses the simplest possible solution to describe an AST (i.e. the parsed contents of a text document): TypeScript interfaces. By relying on the built-in language constructs, we avoid the additional abstraction layers and steep learning curve of a modeling framework.

In short : Langium wants to keep the concepts that have made Xtext successful,
but lift them onto another platform.

Join the Community