News for hackers. Stuff that matters.
Re:Russ Cox is stepping down as the Go tech lead by vyskocilm on Thursday August 01, 2024 @04:42PM (#41133397)
Well written list of what made Go better language during last years. I'd add iterators, the recent big thing from Russ.
Re:Russ Cox is stepping down as the Go tech lead by galkk on Thursday August 01, 2024 @06:42PM (#41134410)
Wow. I haven't followed Go for a while, thanks for that note.

Iterators are very nice addition, even with typical Go fashion of quite ugly syntax.

Re:Russ Cox is stepping down as the Go tech lead by mseepgood on Friday August 02, 2024 @06:46AM (#41137680)
They don't have any syntax that differs from the previous Go versions.
Re:Russ Cox is stepping down as the Go tech lead by kjksf on Friday August 02, 2024 @10:10AM (#41138925)
Just last week I've implemented an iterator for my C++ type and lol to your comment. It was fucking nightmare compared to how you (will) implement an iterator in Go.

I didn't study the reason why Go chose this way over others. I do know they've considered other ways of doing it and concluded this one is best, based on complex criteria.

People who make value judgements like this typically ignore those complex consideration, of which playing well with all the past Go design decisions is the most important.

Frankly, you didn't even bother to say which language does it better or provide a concrete example of the supposedly non-ugly alternative.

Re:Russ Cox is stepping down as the Go tech lead by galkk on Friday August 02, 2024 @11:20AM (#41139566)
C#, python - here are the most mainstream examples of syntax that doesn’t look alien.
Re:Russ Cox is stepping down as the Go tech lead by valyala on Friday August 02, 2024 @05:21AM (#41137280)
Iterators and generics go against the original goals of Go - simplicity and productivity. They complicated Go language specification too much without giving back significant benefits. Iterators and generics also encourage writing unnecessarily complicated code, which makes Go less pleasant to work with. I tried explaining this at https://itnext.io/go-evolves-in-the-wrong-direction-7dfda8a1...
Re:Russ Cox is stepping down as the Go tech lead by jdnendjjd on Friday August 02, 2024 @06:03AM (#41137484)
This argument is brought up again and again, but it is just wrong.

Go had both generics and iterators from the get go. Just not user defined ones.

Thus it is obvious that the creators of the language always saw their need for a simple and productive language

Re:Russ Cox is stepping down as the Go tech lead by joeblubaugh on Friday August 02, 2024 @10:55AM (#41139284)
I do agree with his point that the implicit mutation of the loop body for an iterative will be difficult to debug.
Re:Russ Cox is stepping down as the Go tech lead by eweise on Friday August 02, 2024 @10:58AM (#41139318)
Not obvious to me. We just implemented a streaming solution using the iterator interfaces. They are just functions so reading the code its easy to understand. Adding special language support only serves to obfuscate the actual code.
Re:Russ Cox is stepping down as the Go tech lead by valyala on Saturday August 03, 2024 @06:52AM (#41145837)
Go provides generic types since v1.0 - maps, slices and channels. Go also provides generic functions and operators for working with these types - append, copy, clear, delete. This allows writing clear and efficient code.

There is close to zero practical need in user-defined generic types and generic functions. Go 1.18 opened Pandora box of unnecessary complexity of Go specification and Go type system because of generics. Users started writing overcomplicated generic code instead of writing simple code solving the given concrete task.

Re:Russ Cox is stepping down as the Go tech lead by sterlind on Monday August 05, 2024 @02:29PM (#41163960)
tell me, how often do you find yourself writing `interface{}`?
Re:Russ Cox is stepping down as the Go tech lead by valyala on Monday August 19, 2024 @01:22PM (#41292853)
Very rarely
Re:Russ Cox is stepping down as the Go tech lead by nasretdinov on Friday August 02, 2024 @02:46PM (#41141468)
I'm not sure I can agree about generics. In many cases Go code is already fast enough, so other things come to play, especially type safety. Prior to generics I often had to write some quite complicated (and buggy) reflection code to do something I wanted (e.g. allow to pass functions that take a struct and return a struct+err to the web URL handlers, which would then get auto-JSONed). Generics allow to write similar code much easier and safer.

Generics also allow to write some data structures that would be useful e.g. to speed up AST parsing: writing a custom allocator that would allocate a large chunk of structs of a certain type previously required to copy this code for each type of AST node, which is a nightmare.

Re:Russ Cox is stepping down as the Go tech lead by valyala on Saturday August 03, 2024 @06:58AM (#41145850)
> Prior to generics I often had to write some quite complicated (and buggy) reflection code to do something I wanted (e.g. allow to pass functions that take a struct and return a struct+err to the web URL handlers, which would then get auto-JSONed).

This sounds like a good application for Go interfaces (non-empty interfaces). The majority of generics Go code I've seen could be simplified by using non-empty interfaces without the need of generics.

Re:Russ Cox is stepping down as the Go tech lead by nabhasablue on Friday August 09, 2024 @01:57AM (#41199142)
Totally agree, as far as I know Rob Pike no longer develop Go, that's why. Came corporate people instead who think they do their work, asking community (who said that it should be asked?) what new cocojamba feature should be added (like js)

But what can we do against of this? This what I think: - stuck to use Go 1.16 - fork Go 1.16 and continue develop lang from there - learn OCaml... - give up and consume what these people decide to add to lang next and everytime feel disgust