Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Antlr4 with Langium #195

Open
MrCoder opened this issue Oct 28, 2024 · 0 comments
Open

Replace Antlr4 with Langium #195

MrCoder opened this issue Oct 28, 2024 · 0 comments

Comments

@MrCoder
Copy link
Collaborator

MrCoder commented Oct 28, 2024

[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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant