Is MPS is good for Cross-Platform API development?
1. Is it possible to write code generators for C# and C++ and then use MPS to develop Java API and automatically generate corresponding C# and C++ API.
2. If so, is it possible to develop Java in non-MPS editors and import developed files into MPS for generation or we must develop Java under MPS editor?
3. Is it the right platform for that purpose?
Thanks, Ohad.
2. If so, is it possible to develop Java in non-MPS editors and import developed files into MPS for generation or we must develop Java under MPS editor?
3. Is it the right platform for that purpose?
Thanks, Ohad.
Please sign in to leave a comment.
In fact, one of the basic ideas of MPS is exactly this: write model once and then generate code for different frameworks/platforms/languages. Unfortunately, as it is, MPS does not support multiple generators for a single language, although one can easily build a workaround. Usually it is done via "languages engaged on generator".
In your case, you would have to build yourself the languages to support C#/C++, which would then produce text files accordingly. How to map Java API to other languages is a totally different questions, but MPS gives you the necessary tools.
Answering your second question, it's up to you whether you want to keep Java files and use the "java source stubs" to access the models, or just use MPS editor to create API models. Either would be fine.
Whether MPS is the right tool for you I cannot tell. We would be glad if you choose MPS to solve your task and will provide as much support as we can.
I'm also interested in this question and answer. Thanks.
I think this could be one of important benefits of broadening the adoption of MPS (besides the core idea of DSL-ization of the problem domain, which might have a limited audience in its pure form).
Best,
Karol Depka Pradzinski
Personally I have a ready made output to Java and working to expand to generation of C++, and later probably Swift, from the same source nodes.
Best,
Karol
I'm encountering the same issue. In my case I need three different outputs from the same source nodes (LaTeX, C# and XML). The use case is very simple: LaTeX for documentation, C# for execution logic and XML for configuration purposes. As it is, I cannot use the built-in generator because the three mentioned output types are strictly required.
So I'm interested too in answering these questions!
@Fedor Isakov: How can I implement the workaround you mentioned? Is there any documentation or demo? It would be great if I could use this for now.
Thank's in advance and best regards,
LaAck