# How to implement a MPS DSL for a C++ codebase Follow

Hi,

I'm trying to implement a DSL for a C++ codebase and was wondering if anyone has got it working and could give me some info.

I was not able to find much information on the internet so i am a bit sceptical if this is the right tool for a C++ DSL.

I have also read about plain text generation and was wondering if that is the only current solution for this problem and couldnt find any example projects/implementations online, so if anyone could guide me in the right direction that would be great!

Thanks in advance and greetings,

Cas

Please sign in to leave a comment.

What is the actual problem you're looking to solve? What do you hope to achieve with the DSL? Who will be the DSL users? Who will be developing the DSL?

There are some mathematical model implementations which rely heavily on the Eigen framework. The idea is that nonprogrammers with domain knowledge must be able to implement those models themselves. I am just looking for some example implementations/projects of a C++ DSL in MPS.

So the DSL must be able to generate c++ classes which define the mathematical model.

Based on your description it sounds like MPS could fit your project well. I don't think there exists any implementation of C++ for MPS so plain text generation would be the approach to take initially. A partial implementation of C++ could be built incrementally by abstracting out the plain text generation if/when it would make sense.

Okay, thanks! I'll look into the plain text gen plugin. I've searched for some documentation on this plugin, but wasn't able to find much, do you know where i can find information about implementing this plugin?

Here are some YouTube videos about generating text with MPS' built-in TextGen:

https://www.youtube.com/watch?v=aMRD9_9qWys

https://www.youtube.com/watch?v=yNkJSBNrBlU

The only documentation that I know of about plaintextgen is its README but it seems quite simple to me. In any case, I invite you to join the MPS Slack (http://slack-mps.jetbrains.com/) where you can ask small questions and usually get a quick reply.