Configurations.jl icon indicating copy to clipboard operation
Configurations.jl copied to clipboard

support construction from general key-value data type

Open Roger-luo opened this issue 4 years ago • 2 comments

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 avatar Jun 08 '21 14:06 Roger-luo

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

schlichtanders avatar Feb 20 '23 17:02 schlichtanders

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.

Roger-luo avatar Feb 21 '23 02:02 Roger-luo