3 ms·
I did something similar as in my Bachelors end project. A manufacturer of industrial printers wanted to generate API bindings in multiple languages from a singl
by cdirkx 7y ago
I did something similar as in my Bachelors end project. A manufacturer of industrial printers wanted to generate API bindings in multiple languages from a single source of truth.
We started with just transpiling data definitions based on Apache Thrift [1], but later expanded it to also be able to transpile code checking invariants on the data and integration tests.
Jetbrains' Meta Programming Studio (MPS) [2] was a really great tool for this, as it does a lot of what is mentioned in the article for you. It makes it really easy to define new nodes, syntax rules, parse rules from text, ast-to-ast transformations etc.
[1] https://thrift.apache.org/ https://thrift.apache.org/
[2] https://www.jetbrains.com/mps/ https://www.jetbrains.com/mps/