News for hackers. Stuff that matters.
Re:Fixing for Loops in Go 1.22 by FridgeSeal on Tuesday September 19, 2023 @04:51PM (#37576380)
I think OP’s point is that given the go devs casual disregard for every development in PL theory and design over the last 30 years, it’s amusing to watch them rediscover half the issues from scratch.
Re:Fixing for Loops in Go 1.22 by skybrian on Tuesday September 19, 2023 @05:16PM (#37576827)
This meme is commonly repeated on HN, but I think it's inaccurate or at least greatly exaggerated.

There's nothing casual about Go's approach to language design, and I haven't seen any evidence that they're unaware of what other languages do.

I also haven't seen much criticism of languages other than C++ or Java.

Re:Fixing for Loops in Go 1.22 by bobbylarrybobby on Tuesday September 19, 2023 @05:38PM (#37577145)
If they're aware of how other languages either handle these issues or suffer the consequences of not handling them, then it sure is odd that they consciously decided to introduce the same issues into their own language, only to fix them down the road.
Re:Fixing for Loops in Go 1.22 by skybrian on Tuesday September 19, 2023 @06:06PM (#37577566)
Given Go’s success, it seems like fixing certain footguns much later actually worked out pretty well for them? That doesn’t necessarily mean it was right, but it was perhaps not as big a deal as some people assume.
Re:Fixing for Loops in Go 1.22 by FridgeSeal on Tuesday September 19, 2023 @05:47PM (#37577275)
Sum/Product types. Generics/type-parameters. Bizarre handling of nil in places. Error handling that’s like some deliberately crippled version of a Result<T,E>. The absolutely unhinged decision about zero-value-defaults for types. I’m sure other people can think of some more, but that’s the ones I can think of off the top of my head.

Non PL theory but related: incorrect implementation of monotonic clocks, and then refusing to fix it because “just use google smear time bro”.

Re:Fixing for Loops in Go 1.22 by skybrian on Tuesday September 19, 2023 @06:09PM (#37577613)
Everyone who disagrees with you is “unhinged.” This is just name-calling.
Re:Fixing for Loops in Go 1.22 by FridgeSeal on Wednesday September 20, 2023 @06:58AM (#37582677)
But they’re like, genuinely wild decisions? Unhinged is a great description!

The error design can return the value, or an error, or both, for some inexplicable reason and you can check it - or not - and if your function returned some indication of severe error, and you happen to not check it, you can totes just continue your program, in who knows what invalid state. Oh and also, because the devs are apparently deathly allergic to abstractions of apparently kind, you’ve got to do this janky little if err != nil check at. every. single. point. Which occludes your fundamentally important logic in pointless line noise, with zero opportunity for streamlining or improving the logic or guarantees.

Re:Fixing for Loops in Go 1.22 by kiitos on Tuesday September 19, 2023 @09:31PM (#37579405)
Go definitely implements monotonic clocks correctly?

https://pkg.go.dev/time#hdr-Monotonic_Clocks

Re:Fixing for Loops in Go 1.22 by FridgeSeal on Tuesday September 19, 2023 @09:48PM (#37579500)
Re:Fixing for Loops in Go 1.22 by kiitos on Wednesday September 20, 2023 @01:21AM (#37580635)
That article is so cringeworthy
Re:Fixing for Loops in Go 1.22 by FridgeSeal on Wednesday September 20, 2023 @06:59AM (#37582682)
I disagree, but the style isn’t for everyone.

However, that still doesn’t mean that it’s wrong.

Re:Fixing for Loops in Go 1.22 by eviks on Saturday September 23, 2023 @05:52AM (#37621885)
Rather illustrative article, especially re the false simplicity where the language just silently does the wrong thing

(though I disagree that ".ext" is not an extension of an empty base name)