Migration from Xtext to Langium #212
-
Hi Guys, My team of developers are long-time (5+ years) users of the Xtext/Xtend/Xcore ecosystem. We are currently using it to:
We would like to consider Langium as a possible Xtext replacement at some point, and we have some questions. Based on what I've seen of Langium, your goal is to remove the complexity of things like EMF/JVM/Eclipse and provide a simple solution that supports VS Code extensions for editors along with the ability to generate code for a language server. Is this a fair characterization of the project goals? Will there be any support for syntactically defining independent domain models that can be plugged into grammars? (it appears that Langium only supports the generation of types from the grammar at the present time). We are accustomed to DI using Guice, having come from the Xtext/Java world. Is there a DI mechanism that is supported in Langium? Is there even a need for DI with Langium? Can you elaborate on how scoping and serialization work in Langium? I am accustomed to writing ScopeProviders for Xtext. What type of generator is/will be supported? We have a strong need to generate code and to M2M from our domain models so that we can represent the model in various target formats. Thanks in advance, Greg Lusk |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi @ballcoach12, thank you for your interest in Langium at this early stage :)
Yes. Our main goal is to provide feature parity to Xtext in regards to their language server feature, without all of the overhead that Xtext brings.
Yes, that is planned to be supported in the near future. Discussion on that and implementation proposals are happening in #91.
Yes, we have implemented our small custom DI framework in this file. You can see how one creates their own injection module here and an example how it it is used here. We will soon provide a documentation/tutorials page which will contain more info on the DI mechanism.
Well, then you're in luck. We didn't really see a lot of reason to change how scoping works in Langium compared to Xtext. The main difference is how the default scoping provider is implemented: The default in Xtext provides a static access to all elements everywhere using fully qualified names, while we try to keep it more simple. Instead, we opted for a simple local scope based scoping as the default that is more commonly used in programming languages. However, nothing stops anyone from implementing something similar to Xtext, which we actually did for our
We try to align with the conventions of the JS ecosystem, therefore our recommended solution is to build a CLI for generation. Our own |
Beta Was this translation helpful? Give feedback.
-
@ballcoach12 |
Beta Was this translation helpful? Give feedback.
@ballcoach12
Maybe this MWE2 fragment could be interesting for you:
https://github.com/TypeFox/xtext2langium#readme