nanoserde icon indicating copy to clipboard operation
nanoserde copied to clipboard

HJSON support

Open Gelbpunkt opened this issue 4 years ago • 3 comments

Hi there, I'm looking to potentially use nanoserde because my projects are tiny and only pull in syn (and the like) via serde-derive. The bummer is that I use HJSON for my config files and therefore need a HJSON deserializer (currently I use deser_hjson). Would it be possible to add support for HJSON to nanoserde?

Links: HJSON homepage Test cases

Gelbpunkt avatar Apr 12 '21 14:04 Gelbpunkt

Hjson looks interesting, however, I am not personally interested in it enough to implement the parser myself.

Adding HJSON support looks very doable though - from first glance, HJSON looks pretty similar to RON, so parse may share a lot of implementation details with RON

not-fl3 avatar Apr 12 '21 15:04 not-fl3

I can try to see what I can do to port the HJSON implementation to nanoserde myself. Do you have any hints for implementing a new parser with nanoserde for me to tackle it? I'm new to writing custom deserializers and deser_hjson has things like EnumAccess traits from serde which don't seem to have an equivalent in nanoserde (or I am blind?).

Gelbpunkt avatar Apr 12 '21 16:04 Gelbpunkt

I would recommend checking nanoserde's ron parser instead of serde's stuff - nanoserde is too different internally and most concepts would not map 1 by 1 from serde to nanoserde

not-fl3 avatar Apr 12 '21 17:04 not-fl3