Skip to content

Replace Antlr4 with Langium #195

Open
@MrCoder

Description

[Draft] Langium is a new DSL parser.

Benifits:

It offers two main benifits - a. it can generate a default LSP implemenation and b. it is performant.

Built-in LSP implementation

Even though this renderer (@zenuml/core) does not include an Editor. It is almost impossible to build a good editor without involving the DSL parser which is part of the core renderer package.

Attempts of LSP implementation on Antlr4

1. (NOT) AntlrVSIX

You may come across AntlrVSIX (https://github.com/kaby76/AntlrVSIX) if search keywords like "Antlr4 LSP". It is a LSP that supplort Antlr as a lanaguge NOT languages developed using Antlr. Also it is mainly designed as a Visual Studio Extension.

Performance

According to the offical document, "Langium is based off of Chevrontain".

Chevrontain is about 5 times performant than Antlr4. It is even slightly faster than HandBuilt.
image

Challenges / Questions

Does Langium expose positions of characters parsed?

It has a built-in implementation of LSP (Language Server Protocol) which can be used to configure Monaco editor.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions