Show HN: Jason – A new JSON Library for Go
1–10 of 55 posts
Re: Show HN: Jason – A new JSON Library for Go
#2Re: Show HN: Jason – A new JSON Library for Go
#3[deleted]
The author does seem to say the library is more focused on reading the data rather than writing it.
Whether or not this is a benefit or not is up to you and your use case I guess.
Re: Show HN: Jason – A new JSON Library for Go
#4[deleted]
That's what the Get-method in Jason is trying to solve. Similar to how bitly/go-simplejson does it, but with some fine tuning.
Re: Show HN: Jason – A new JSON Library for Go
#5Re: Show HN: Jason – A new JSON Library for Go
#6I would stray away from making the library name too similar in phonetic sound to the data it's meant to process. There was already enough confusion in an office I worked at with a non-developer whose name was "Jason"
Re: Show HN: Jason – A new JSON Library for Go
#7Shameless but relevant plug - if you do know the structure of your JSON in advance, I wrote a tool for automatically generating the appropriate struct definition for it: https://github.com/ChimeraCoder/gojson
(I see these as complimentary tools, rather than conflicting or competing, since they would have two different use cases).
Re: Show HN: Jason – A new JSON Library for Go
#8[deleted]
It's unfortunate that so many of these "Show HN" threads turn into this.
Re: Show HN: Jason – A new JSON Library for Go
#9Re: Show HN: Jason – A new JSON Library for Go
#10This looks like a good approach to dealing with heterogeneous JSON! (ie, JSON that has an unknown and/or variable structure.) I've always found encoding/json a little clunky for this. Shameless but relevant plug - if you do know the structure of your JSON in advance, I wrote a tool for automatically generating the appropriate struct definition for it: https://github.com/ChimeraCoder/gojson (I see these as complimenta…
If your main use case is JSON as a serialized representation of the ever same object (plus or minus a few optional fields), encoding/json is by far the fastest and most typesafe way to go.
(edit: Protip - for the really really fastest way to demarshal JSON, look here https://github.com/pquerna/ffjson for some reflection-free extra speed after your code has settled down)
But if your objects can be heterogenous for whatever reasons (think third-party systems, different languages, legacy stacks...) or you're dealing with different kinds of objects landing on the same controller, jason is the perfect complimentary device to deal with more dynamic structures. I've long sought for something like this, thanks to the OP!