Live data from Hacker News

Go 1.21 Release Candidate

go.dev

11–20 of 236 posts

Re: Go 1.21 Release Candidate

#11

Seems like a really substantial release to me. The new built in functions min, max, and clear are a bit surprising, even having followed the discussions around them. The perf improvements seem pretty great, I’m sure those will get much love here. Personally, I’m most excited about log/slog and the experimental fix to loop variable shadowing. I’ve never worked in a language with a sane logging ecosystem, so I think sl…

As a non-developer who has only gone as far as "hello world" in Go, I'm baffled by the idea that the log/slog thing is new - that seems like an absolutely basic language feature. TBH I'd say the same about min/max, but could forgive those being absent since Go isn't known for being numerically-focused...

There's been a "log" package since forever, but slog adds structured logging with fields and some other things. I don't think many standard libraries have that built in?

Re: Go 1.21 Release Candidate

#12
I enjoy Go so much. It is almost perfect language for getting things done, but I still can't understand some design choices.

Does someone knows why Go uses env variables (like GOOS and GOARCH) instead command line arguments?

Re: Go 1.21 Release Candidate

#13

Seems like a really substantial release to me. The new built in functions min, max, and clear are a bit surprising, even having followed the discussions around them. The perf improvements seem pretty great, I’m sure those will get much love here. Personally, I’m most excited about log/slog and the experimental fix to loop variable shadowing. I’ve never worked in a language with a sane logging ecosystem, so I think sl…

> The new built in functions min, max, and clear are a bit surprising, even having followed the discussions around them.

Was that discussion pre-generics?

Most of functions and libraries introduced in Go 1.21 is stuff people already put in community libraries (lodash being probably most popular, despise utterly nonsensical name not relating to anything it does) so it is just potentially cutting extra dependencies for many projects.

Re: Go 1.21 Release Candidate

#14
post #10

Earlier quoted context omitted.

As a non-developer who has only gone as far as "hello world" in Go, I'm baffled by the idea that the log/slog thing is new - that seems like an absolutely basic language feature. TBH I'd say the same about min/max, but could forgive those being absent since Go isn't known for being numerically-focused...

> As a non-developer who has only gone as far as "hello world" in Go, I'm baffled by the idea that the log/slog thing is new - that seems like an absolutely basic language feature. Then you'd be even more surprised when you learn that the vast majority of languages do not have standard logging library in core. Most have one or few common libraries that community developed instead, but they are not in stdlib, and if s…

I have evidently been spoiled by Python and it's abundance of batteries.

Re: Go 1.21 Release Candidate

#18
It is interesting to see them add things like the "clear" function for maps and slices after suggesting to simply loop and delete each key one at a time for so long. Is this a result of the generics work that makes implementation easier vs. the extra work of making a new "magic" function (like "make", etc.)?

Re: Go 1.21 Release Candidate

#20

Seems like a really substantial release to me. The new built in functions min, max, and clear are a bit surprising, even having followed the discussions around them. The perf improvements seem pretty great, I’m sure those will get much love here. Personally, I’m most excited about log/slog and the experimental fix to loop variable shadowing. I’ve never worked in a language with a sane logging ecosystem, so I think sl…

As a non-developer who has only gone as far as "hello world" in Go, I'm baffled by the idea that the log/slog thing is new - that seems like an absolutely basic language feature. TBH I'd say the same about min/max, but could forgive those being absent since Go isn't known for being numerically-focused...

Most languages include unstructured logging libraries in the standard library, including Go. Structured logging is usually provided by third party libraries.
Post reply on HN