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.
5 comments
Thanks for bringing this up, an excellent question.

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.
0
Hi.
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
0
Let's expand a bit on this question - who, of the MPS Forum members has done or is planning to do some cross-platform code generation in MPS? Speak up :).

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
0
Hi, Karol. I'm also interested in answers to these questions. Before one's diving into depths of crossplatform DSL engineering, some basic problems should be solved. For now I see lack of model portability between different releases of MPS. I think MPS should have a stabilization period during which all major concerns about it's internal architecture along with the architecture of DSL representing models will be solved or will have solid idea which won't change anymore in an observable future. I'm personally really looking forward to play with web-based MPS, and until then I barely will be doing something serious with this tool.
0
Hi all,

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
0

Please sign in to leave a comment.