Multi-languages code generation

QuadDamaged

Ars Praefectus
3,983
Subscriptor++
Hi all,

I am trying to find a tool that would let me generate Plain Old (Csharp|Python|Typescript) Objects that can serialise to a common json and supports inheritance or dynamic dispatch.

I would have used Protobuf but there is no support for inheritance and the typescript code doesn’t serialise to json.

There has to be a tool that translates a schema to multiple languages but I can’t find anything that satisfies all requirements out of the box.

Do I really have to roll my own?

I guess I was looking for an excuse to introduce rust in my new codebase...
 

Apteris

Ars Tribunus Angusticlavius
9,589
Subscriptor
I stumbled across Jsonnet today, which I don't think is what you want, but some more clicking led me to FlatBuffers, which might be what you're looking for.

Given that I understand your question as "which cross-platform interface description language with support for inheritance or dynamic dispatch should I use?", I will also link to the Wiki page on IDLs.