News for hackers. Stuff that matters.
Re:A New Go API for JSON by cbarrick on Wednesday November 04, 2026 @02:52PM (#50370631)
The fact that this took 6 years to land stood out to me.

I'm not entirely surprised, and I'm glad the Go team is carefully considering their interfaces before launching. But 6 years seems like a lot of work to land a JSON API.

Re:A New Go API for JSON by awesome_dude on Wednesday November 04, 2026 @03:04PM (#50370767)
Sometimes I wonder about Go's velocity - generics (something that I still haven't used beyond the tutorials) took an age as well

JSON processing, quite markedly, is renown in Go for being slow, so I don't really understand why it took so long

Re:A New Go API for JSON by hnlmorg on Wednesday November 04, 2026 @03:14PM (#50370883)
I think in the case of JSON, it was “good enough”. People who found this to be a problem would use one of the many 3rd party options.

I kind of like that the standard library doesn’t move fast. It makes it easier to fit the ecosystem into my head (unlike, for example, the JavaScript ecosystem where I find code doesn’t survive 2 years before failing to compile).

But I do agree that slow and steady produces its own problems. Your example of generics is a good one. But think the example of Go modules is another, perhaps even better, example of how sometimes the Go team really should have accelerated their efforts on.

Re:A New Go API for JSON by awesome_dude on Wednesday November 04, 2026 @05:31PM (#50372400)
lol, I don't mean to be contrary, but I looked into dependency management (partly because of the modules implementation, partly because of early teething issues, and partly out of pure curiousity.

Dependency management is a freaking nightmare, nobody has managed to create something that is bulletproof, not cargo, npm, apt, yum, nix, homebrew, nothing.

The key issue is that you're managing 3rd party software that may or may not adhere to the prescribed lifecycle/versioning

The Linux variants do it by each having dedicated teams watching upstream sources, taking what they believe to be whatever they feel is right, building for their nominated target(s), then testing, before deploying (on top of that, all of these steps vary in importance and rigor depending on numerous variables)

For programming libraries (which is what depmod, goose, vgo, and modules are managing) it's just as bad, if not harder, because their very nature is to provide a base upon which other developers can turn into whatever their imagination.

Add to that, modules was (initially) written by people who were dealing with a slightly different ecosystem; Google rather famously has a monorepo, making their lives a little easier when it comes to managing dependencies.

So, with those things in mind, dependency management is always going to be a hard problem that is opinionated (eg. I have a firm opinion that there should be an easier way to "pin" a dependency, other than vendoring - note that this isn't an invitation to every junior Go developer to come and claim go.sum does that. It doesn't. go.sum is a log of what dependencies were used for the last build by whomever wrote to it)

Re:A New Go API for JSON by hnlmorg on Thursday November 05, 2026 @01:55AM (#50376002)
I’ve written package management tools so I disagree that dependency management is hard.

But my point was Go waited until there were multiple established 3rd party package management tools for Go already in widespread use before even releasing their own experimental implementation.

Their inaction caused far more disruption to the ecosystem because people got fed up of waiting, implemented their own, integrated it into their workflow and then had to reintegrate a whole new system all over again a year or two later.

Your point about Googles needs is the one often cited for Gos inaction. But I think that actually makes the situation worse. Because if the Go team cannot empathise with use cases outside of one bespoke enterprise, then it really shouldn’t be released as a general purpose language available for all to use.

And I say this as someone who generally likes the language.

Re:A New Go API for JSON by Mawr on Thursday November 05, 2026 @03:43AM (#50376756)
Interesting, I came to the opposite conclusions, but for the same reasons. I like that they waited to see what alternative proposals/implementations were out there before they decided on their own.

Especially since "Go team cannot empathise with use cases outside of one bespoke enterprise" — it shows self-awareness of their shorcomings. I think it's wise to let the target audience explore the design space themselves a bit first. Considerably lowers the risk of cementing the wrong design.

I do somewhat remember the drama around this at the time, but I my impression was that of a petulent community of various dependency management projects with too much ego attached to them to see the bigger, long-term picture.

Re:A New Go API for JSON by hnlmorg on Thursday November 05, 2026 @04:29PM (#50384701)
That’s an interesting take. I appreciate the alternative view point and I can’t say I disagree with the way you’re looking at it.

Thanks for sharing.

Re:A New Go API for JSON by cxr on Thursday November 05, 2026 @05:41AM (#50377584)
[delayed]
Re:A New Go API for JSON by kbolino on Thursday November 05, 2026 @09:59AM (#50379917)
> there should be an easier way to "pin" a dependency, other than vendoring

Put this in your go.mod:

  replace example.com/package-to-pin => example.com/package-to-pin v1.2.3
Then go.sum will do its actual job (along with GOSUMDB) and ensure you get exactly the revision of the code that you want.
Re:A New Go API for JSON by win311fwg on Wednesday November 04, 2026 @03:28PM (#50371060)
> generics (something that I still haven't used beyond the tutorials) took an age as well

Only about a year from when the Haskell guys lent their expertise and it landing in a release. That's actually fairly quick given that it was a pretty significant change under the hood and constrained by only two releases annually.

The Go team was always clear that they didn't have the necessary expertise internally and were relying on the open source community to lend a hand. Unfortunately, open source doesn't mean open willingness to contribute.

Re:A New Go API for JSON by enneff on Wednesday November 04, 2026 @03:50PM (#50371317)
Haskell guys? Got a reference to this? That’s news to me.
Re:A New Go API for JSON by 0x696C6961 on Wednesday November 04, 2026 @04:11PM (#50371583)
I'm not sure about the haskell association, but search for "Featherweight Go"
Re:A New Go API for JSON by enneff on Wednesday November 04, 2026 @04:47PM (#50372022)
Thanks for the pointer. The reference makes sense now, as Philip Wadler is a coauthor of that paper.
Re:A New Go API for JSON by pjmlp on Thursday November 05, 2026 @04:53AM (#50377261)
Those guys were the same that helped out with generics in Java, they even published a book in 2006,

https://homepages.inf.ed.ac.uk/wadler/topics/gj.html

Before Featherweight Go, there was Featherweight Java.

So maybe a language designed in 2012 (v 1.0 release year), should learn from history instead of hand-waving it away as needless fluff.

> In retrospect, we were biased too much by experience with C++ without concepts and Java generics. We would have been well-served to spend more time with CLU and C++ concepts earlier.

https://github.com/golang/proposal/blob/master/design/go2dra...

And not all on the team were convinced, here Rob Pike,

> I think the transition to getting polymorphism into the language through generics is has still got some years to work through there's still things that don't quite work right

https://youtu.be/yE5Tpp2BSGw?t=2134

Re:A New Go API for JSON by win311fwg on Thursday November 05, 2026 @05:01AM (#50377327)
> instead of hand-waving it away as needless fluff.

If you go back and watch the original Go announcement it was made abundantly clear that they believed Go did need generics at the time but that they didn't have the expertise to do it. Yes it is true that the book was already written on it, but that doesn't mean anyone on the Go team was familiar with it or had the time to become familiar with it. Programming languages do not require gods to design them. Imperfect humans can too.

The experts on HN who know all the ins and outs of generics could have contributed but, you know, shitposting "go doesn't have generics lol" was apparently a better use of their time. But it is certainly not for anyone else to do decide how they live their life.

Re:A New Go API for JSON by pjmlp on Thursday November 05, 2026 @05:07AM (#50377362)
Gonuts is full of content that they were not keen in generics, in fact gccgo has been abandoned, and I expect it to eventually follow gcj and be removed from GCC.

Go culture is not welcoming to experts contributions, Rust, D, C#, Swift and others, heck even Java, are more open arms to language designers.

Re:A New Go API for JSON by win311fwg on Thursday November 05, 2026 @05:13AM (#50377397)
Nobody is keen about language features. Each new one adds complexity. That isn't the same as failing to recognize a need, though. And we know the Go team recognized the need as they clearly kept working on generics all the way from the very beginnings up until the Haskell muscle showed up. The receipts are clear and present. The results just weren't good, as one would expect from a team who weren't shy to say that they didn't have the expertise necessary.

You'd think one of the HN experts would have shown up to offer that expertise, but I guess there was a lot of "go doesn't have generics lol" to get out.

Re:A New Go API for JSON by pjmlp on Thursday November 05, 2026 @07:37AM (#50378383)
Some did try, and were welcomed with stones, clubs and pitchforks, until leadership had to reach out for help, from the same team that designed Java generics, years before Go v1.0 came to materialise.

The Haskell muscle had proven their skills already with Featherweight Java, in 2006.

Re:A New Go API for JSON by win311fwg on Thursday November 05, 2026 @09:12AM (#50379290)
The same people who were working on generics in Go prior to v1 were also still there to help out when it eventually landed, so whatever stones, clubs, and pitchforks you saw weren't compelling enough to scare one away from making it happen. Such things don't get in the way when do something is worthwhile.

But obviously "go doesn't have generics lol" comments were even more important. Imagine what would have happened to HN if that wasn't repeated multiple times daily for years!

Re:A New Go API for JSON by pjmlp on Thursday November 05, 2026 @09:29AM (#50379503)
To offer help, the receiving end must be open to take it.
Re:A New Go API for JSON by win311fwg on Thursday November 05, 2026 @09:40AM (#50379651)
And there was plenty of help given by others who also weren't experts. There was no lack of trying within a sea of incapable people. Unfortunately, that wasn't what the project needed. It already had a team full of blub developers, it being a language for them.
Re:A New Go API for JSON by pjmlp on Thursday November 05, 2026 @10:15AM (#50380128)
It is after all a language designed for not smart people, as per Rob Pike own words.
Re:A New Go API for JSON by pwdisswordfishq on Thursday November 05, 2026 @07:02AM (#50378133)
The key point here is our programming language designers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school…
Re:A New Go API for JSON by kbolino on Thursday November 05, 2026 @10:03AM (#50379982)
Robert Griesemer, the youngest of Go's original authors (the other two are Rob Pike and Ken Thompson) was 45 when they started working on Go.
Re:A New Go API for JSON by Philip-J-Fry on Wednesday November 04, 2026 @06:06PM (#50372702)
For like 99% of use cases encoding/json was fine. Of course improvements are welcomed. But personally I've lead development of the backend of part one of the biggest sites of its kind in the world, and we just used encoding/json and net/http. Most of our use cases are just building APIs, client facing ones, internal ones, trusted third-parties. These systems have pretty high throughput, more than most people will ever work on.

Within our company I saw people in other teams writing their own optimised JSON libraries for whatever hellish reason. I always reiterated the point that as soon as that app made a single IO request all those nanosecond savings are invisible. Yes, it affects your total CPU time for processing a request but compute was never ever a limitation for us and it's likely not a limitation for most people. And if the trade off is your app needs scale slightly larger versus writing custom JSON code or pulling in a third party dependency, then I'm accepting the larger scaling.

The biggest benefit of encoding/json/v2 isn't the speed, it's the improved API.

Re:A New Go API for JSON by nonethewiser on Wednesday November 04, 2026 @10:12PM (#50374686)
Go is an incomplete language masquerading as a simple one.
Re:A New Go API for JSON by throwaway894345 on Wednesday November 04, 2026 @11:11PM (#50375070)
Meanwhile people are happily shipping widely used software in Go :shrug:
Re:A New Go API for JSON by pjmlp on Thursday November 05, 2026 @04:57AM (#50377293)
Back in the day we shipped software in ZX Spectrum and C64 BASIC, among other variants as well.

Wordpress powered by PHP is also the most widely deployed CMS.

That argument is not as great as you think it is.

Re:A New Go API for JSON by throwaway894345 on Thursday November 05, 2026 @08:44AM (#50378978)
Sounds like those technologies were pretty great for their day if they motivated a bunch of people to use them over boondoggle alternatives :shrug:

> That argument is not as great as you think it is.

But at least it is an argument in contrast to the comment I was replying to.