Any atdgen wizards here with advice for writing a new bakend (Rust) ?
My goal is to be able to write one atdgen def, then to generate types for OCaml, ReScript, Rust, as well as serialization / deserialization types.
Any atdgen wizards here with advice for writing a new bakend (Rust) ?
My goal is to be able to write one atdgen def, then to generate types for OCaml, ReScript, Rust, as well as serialization / deserialization types.
I don’t know much about atdgen, but it looks like existing backends “just” take an ATD type description and output a source file in the desired language to express it. The workflow to create a new backend for a new language would presumably be the following:
Have you tried following this process? Can you say more precisely where you are stuck, where you would need help?
If you look in the PR history there was bunch of backends added to atdgen recently, for typescript and python at least. It should give you a good idea of what is required to support another language. I’d encourage you to open an issue or a PR on github if you want more details.
Now, I have not tried this process yet. I could not find any code / tutorial online on adding a backend to atdgen and was hoping, given how similar atdgen syntax is to OCaml, that someone here may have had experience with this.
Thanks, this looks like a good place to start.
Hello,
We don’t have a guide for adding new backends yet but it may be a good time to start one. As @Khady said, Python and TypeScript are the latest backends we added and they’re the best examples so far since they avoid the mistakes of their predecessors.
Here are a few more tips: