Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question/Wishlist] Using JSON for the protocol instead of XML #408

Open
fwcd opened this issue Jan 29, 2022 · 1 comment
Open

[Question/Wishlist] Using JSON for the protocol instead of XML #408

fwcd opened this issue Jan 29, 2022 · 1 comment

Comments

@fwcd
Copy link
Contributor

fwcd commented Jan 29, 2022

This is more of a general question rather than a specific issue. Has using JSON instead of XML for the protocol ever been considered, apart from legacy reasons?

While such a change would have quite a big impact on the way the different clients and the server handle communication, I think there are strong reasons for at least considering such a change e.g. for the next year:

  • JSON is ubiquitous, simple and easy to parse/serialize in almost every mainstream language (even hand-rolling a parser isn't too hard)
  • JSON maps very naturally to data structures in almost every mainstream language (in contrast to XML, where especially serialization can be very ambiguous, with regard to whether e.g. something should be serialized as text, an element, an attribute, etc.)
  • JSON is human-readable, debuggable and quite a bit less verbose than XML

A particular pain point with XML that I've encountered myself is e.g. the lack of good library support for Rust, leaving us essentially with either the option of hand-writing the XML mappings (which is tedious and error-prone) or using pretty limited tools for defining automatic mappings between structs and XML, which still require careful manual review of certain edge cases.

While these problems might not apply (as much) to other languages, JSON would solve pretty much all of these issues and at the same time simplify the protocol in general.

@xeruf
Copy link
Member

xeruf commented Mar 4, 2022

Yeah, sometimes I have been unhappy with XML, too - but it is pretty stable now and every major language should support it. I am pretty surprised there is no parser for Rust yet.

We have quite a few big construction zones that concern the user-friendliness and maintainability of the project, so if this is ever considered, not in the near-term, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants