-
Hi all, I am the founder of wasp-lang (https://github.com/wasp-lang/wasp) and we implemented our compiler in Haskell. Wasp is a simple DSL. We implemented a compiler (analyzer + generator) that does transpilation to JS, and we implemented our own language server for Wasp. Looking at Langium, it does seem like it could be a good fit for Wasp, so I was hoping to learn more -> if it significantly simplified development for us, it could be valuable to switch to it. I did quickly skim the docs, but I feel it will take some more time for me to properly grasp it since I am not super up to date with compiler jargon, so I was hoping somebody could give me a quick idea if Langium is indeed a potentially good match and if it would make sense for me to learn further about it. I would also love to understand how easier it would make things for us -> I guess right now it generates compiler frontend (from string to AST) and LSP? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @Martinsos,
Right, Langium is basically an all-in-one compiler frontend framework. As long as your language is somehow EBNF expressable (in our grammar language DSL) it infers all the information it needs to build a parser, AST (and generate the TypeScript interfaces/types for that), resolving cross references and provide LSP support right out of the box.
It likely will, that's why we built it for ourselves in the first place :D However, there's one question I would like to ask back: Is your language dynamically or statically typed? While purely dynamic languages are possible in Langium, a ton of its features (especially the LSP parts) are build on top of the cross reference resolution feature, which require some level of static typing. I just saw that your language seems to interop with JavaScript, that's why the question came up. Note that embedding semantic information in the language (i.e. validation, type systems, scoping rules, etc.) still requires some work, so not everything is automatically done by the framework, as it can only deduce ever so much information from your grammar. |
Beta Was this translation helpful? Give feedback.
Hey @Martinsos,
Right, Langium is basically an all-in-one compiler frontend framework. As long as your language is somehow EBNF expressable (in our grammar language DSL) it infers all the information it needs to build a parser, AST (and generate the TypeScript interfaces/types for that), resolving cross references and provide LSP support right out of the box.
It likely will, that's why we built it for ourselves in the first place :D
However, there…