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

[specification] Store enum fields as strings #1316

Open
xyaoinum opened this issue Oct 28, 2024 · 1 comment
Open

[specification] Store enum fields as strings #1316

xyaoinum opened this issue Oct 28, 2024 · 1 comment
Labels
spec Relates to the spec

Comments

@xyaoinum
Copy link
Contributor

xyaoinum commented Oct 28, 2024

The current specification defines certain IG enum fields, such as seller capability, as byte sequences. This appears to be an implementation-level optimization, but it's unnecessary at the specification level.

Instead, the specification should directly use string types for these fields.

@qingxinwu
Copy link
Collaborator

it cannot be a simply string, due to the interest group size estimation part (step 9 of https://wicg.github.io/turtledove/#interest-group-estimated-size). Its size needs to be 4 bytes. So we defined a user defined "spec enum" type, which is different from IDL enum. See this discussion (https://github.com/WICG/turtledove/pull/1047/files#r1508216439) on the github pull request

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

No branches or pull requests

3 participants