News for hackers. Stuff that matters.
Re:Transpiling between any programming languages (2019) by cdirkx on Sunday February 16, 2020 @09:28AM (#22341673)
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/

[2] https://www.jetbrains.com/mps/

There are no comments on this comment yet.