Hacker News new | ask | show | jobs
by jillesvangurp 2810 days ago
It's a simple binary format similar to e.g. protocol buffers. You write an idl and then generate code for different languages. The reason they went for this is that is compact. This kind of matters because this stuff is actually stored in stellar in large quantities.

It's a pretty old ietf standard actually. I recently had a discussion on this on their slack channel making the point that the choice for this was a bit unfortunate given that this is a relatively obscure format with not a lot of developer ecosystem around it.

Because of this, the stellar guys are actually maintaining their own code generation tool for this because there's nothing else out there apparently. It's called xdrgen. It generates code for a few languages. If you want to understand xdr, that's a good place to start. You can find the idl in stellar core.

I actually have an open bug for the java code generation with them, it generates broken code currently.

1 comments

Any idea why they picked XDR rather than something that is more widely used in the present day, like Thrift? That is efficient on the wire, and pretty widely supported:

https://thrift.apache.org/docs/Languages

they wanted something standard and I guess did not realize that the IETF standard for XDR is not that widely used. I agree it would have been nicer if they went for something like thrift instead. However, it's done and I don't think they can fix this without breaking compatibility.

I do wonder why XDR sort of failed to get used and why people went ahead and created protocol bufs and thrift as alternatives.