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

support construction from general key-value data type #44

Open
Roger-luo opened this issue Jun 8, 2021 · 2 comments
Open

support construction from general key-value data type #44

Roger-luo opened this issue Jun 8, 2021 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@Roger-luo
Copy link
Owner

in principle we should be able to generate the struct from general key-value data type that defines the iterate method and the element type eltype gives Pair{String, X} or Pair{Symbol, X}, this applies to the return type of JSON3.read

@Roger-luo Roger-luo added the enhancement New feature or request label Jun 8, 2021
@Roger-luo Roger-luo added this to the v1.0.0 milestone Dec 2, 2021
@schlichtanders
Copy link

I also stumbled into this as Dict{Symbol} comes natural because of the performance benefits, but it does not seem to be supported as of now

@Roger-luo
Copy link
Owner Author

I'm actually more thinking about something closer to rust's serde now - the key value is not directly exposed to the user but instead, a Serializer and Deserializer object are exposed.

Configurations at the beginning were not designed for performance, and Symbol is not a general string, thus only String is supported. AFAIK Symbol is only faster when it encounters comparison tho, so I'm not sure if there are more specific cases where Symbol is better. My understanding is one should use specific tokens for the key since usually they can be enumerated.

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

No branches or pull requests

2 participants