Huh, I'm glad to see generic Min/Max functions, but the fact that they're built-ins is a little odd to me. I would have expected them to put a generic math library into the stdlib instead. The fact the stdlib math package only works with float64s has always struck me as a poorly thought out decision.
Go 1.21 Release Candidate
91–100 of 236 posts
Re: Go 1.21 Release Candidate
#92I'm a bit surprised that the slog package was added to the stdlib, but it does seem to use the API that I think is the most ergonomic across libraries I saw in Go (specifically, varargs for key values, and the ability to create subloggers using .With), so I guess it's nice most of the community will standardize around it. If all goes well, you won't have different libraries using different loggers anymore, in some no…
Also a bit surprised how fast it was added to the stdlib, but perhaps there was a lot more consensus on the api compared to other golang proposals.
Re: Go 1.21 Release Candidate
#93I wonder if the new stdlib logger is featured enough to get rid of logrus/zerolog.
I'm wondering the same. Anyone already played for some time with the pkg?
Re: Go 1.21 Release Candidate
#94> New built-in functions: min, max and clear. What a mistake.. reserved keywords are words I can no longer use for myself... Zig does it better by requiring a prefix @ for most their builtin needs
Re: Go 1.21 Release Candidate
#95in some of my use cases, I need make sure source code is fully protected, neither Node nor Django can do that well, Go will be perfect as it is compiled, however there is nothing like MERN or Django in Go(yet). Another option will be Java, but I do not know Java.
Re: Go 1.21 Release Candidate
#96It 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.)?
It might also be that they’ve worked their way down the priority list and are getting to these features that are largely just to tidy up code.
Re: Go 1.21 Release Candidate
#97> New built-in functions: min, max and clear. What a mistake.. reserved keywords are words I can no longer use for myself... Zig does it better by requiring a prefix @ for most their builtin needs
You can continue to declare your own entities with these names.
Re: Go 1.21 Release Candidate
#98I hope the experimental fix makes it into the next version of Go by default.
Re: Go 1.21 Release Candidate
#99Earlier quoted context omitted.
What big thing are you expecting? Go is more of a stable language, a reliable and boring language for building software now that in ten years you can still maintain. Go isn't peaking, Go isn't an exciting or cool or hype language, it's just... there. And that's just fine. Too many languages just started borrowing features from others, saying "yes" to every suggestion, until they got out of control and all over the pl…
> ...generics took a long time because they wanted to understand the problem and not add more like what happened to Java Just out of curiosity, can anyone regale me with that history with Java's generics?
Re: Go 1.21 Release Candidate
#100Was there a push to get it released today?