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

Use internally-tagged variant? #8

Open
jD91mZM2 opened this issue Jan 2, 2018 · 2 comments
Open

Use internally-tagged variant? #8

jD91mZM2 opened this issue Jan 2, 2018 · 2 comments

Comments

@jD91mZM2
Copy link
Contributor

jD91mZM2 commented Jan 2, 2018

Currently packets look like

[7, [["data", "goes", "here"]]]

. Should we change MsgPack to look like

["login", "data", "goes", "here"]

?

Pros:

  • Order of enum variants doesn't matter. Clients won't break every time I add a variant.
  • Easier to get right and more difficult to get wrong.

Cons:

  • Larger in size.
  • Possibly more difficult to decode in strongly typed languages that aren't Rust.

Will this completely break any existing library?
Not as I'm aware. synacrb and goSynac can supposedly both be changed to the other format without too much pain.

@jD91mZM2
Copy link
Contributor Author

jD91mZM2 commented Jan 2, 2018

@Mnpn03 gave me a thumbs up over from discord

@jD91mZM2
Copy link
Contributor Author

jD91mZM2 commented Jan 3, 2018

Never mind. 3Hren/msgpack-rust#153 blocks this.

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

1 participant