[HN Gopher] Go 1.17 Release Notes
___________________________________________________________________
Go 1.17 Release Notes
Author : aofeisheng
Score : 39 points
Date : 2021-08-16 19:16 UTC (3 hours ago)
(HTM) web link (golang.org)
(TXT) w3m dump (golang.org)
| matthewmacleod wrote:
| A couple of nice tweaks that I'm happy to see.
|
| I didn't completely expect it, but I now find myself reaching for
| Go first when writing something like a small script or utility
| that I'd previously have written in something like Ruby or
| Python. It all feels much more solid.
|
| That said... I really chafe against the anaemic type system when
| writing anything a larger than that. I hate not being able to
| communicate things like "this can never be nil and if it's is
| then it's an error" to the compiler. I resent having to write
| three lines of boilerplate every time I want to reverse a
| flipping 10-item slice, and the design decisions leading to the
| existence of `time.IsZero()` are bordering on criminal.
|
| I don't know if I'm the odd one out for feeling like that - parts
| of the language and ecosystem are just absolutely wonderful to
| work with, but the unergonomic sharp edges bother me so much that
| I end up finding it really _annoying_ to write a lot of it.
| avl999 wrote:
| Go is my favorite language to write code in. I was very skeptical
| when I first started learning it for a new job with error
| handling that looked archaic in comparison to exceptions but once
| I got the hang of it it has quickly become my preferred language
| of choice for any project.
|
| Once generics are finally added the language should basically be
| a no-brainer for any serious production code.
| machinecontrol wrote:
| It looks like the language is really maturing. The changes are
| all fairly minor optimizations and improvements to the stdlib.
| Impressed with the Go team's discipline for simplicity and
| stability.
| est31 wrote:
| Between the 1 release in 2012 and the 1.13 release in 2019,
| this has been the development model of the language. So it's
| nothing _new_ in Go 's evolution.
| dang wrote:
| Two recent related threads:
|
| _Go 1.17 Beta_ - https://news.ycombinator.com/item?id=27462884 -
| June 2021 (118 comments)
|
| _Go 1.17 is deprecating the traditional use of 'go get'_ -
| https://news.ycombinator.com/item?id=27630625 - June 2021 (215
| comments)
| benhoyt wrote:
| To me, the most interesting change is the performance improvement
| due to the new register-based calling convention. Your CPU-bound
| programs will magically get 5% faster when compiled with 1.17:
|
| > Go 1.17 implements a new way of passing function arguments and
| results using registers instead of the stack. Benchmarks for a
| representative set of Go packages and programs show performance
| improvements of about 5%, and a typical reduction in binary size
| of about 2%. This is currently enabled for Linux, macOS, and
| Windows on the 64-bit x86 architecture (the linux/amd64,
| darwin/amd64, and windows/amd64 ports).
|
| I love how they're doing it in such an iterative fashion: even
| assembly functions don't have to be rewritten. Then again, I
| guess doing it progressively like this is the only feasible way
| to avoid reworking all the low-level assembly routines in one
| fell swoop.
| pxue wrote:
| The go code I wrote in 2015 looks and works exactly the same way
| new Go code I'm writing today. Even with all the upgrades.
|
| You have no idea how amazing that feels.
| kplex wrote:
| Worth it if only for the go.mod tidy-up, how that made it into a
| release in the first place baffles me.
| Techasura wrote:
| Never tried to write Go before, maybe it's time that I stop by.
| nwmcsween wrote:
| It's meh for a language, it's simple which is what they are
| trying to achieve but it all comes with trade offs like all
| programming languages. I would say a large portion of a
| language is how you mesh with the syntax and tooling around it.
| itake wrote:
| what about this release makes you want to try it?
| tech_dreamer wrote:
| Golang release no longer excites me in a good way - I know my old
| aws hosted apps continue to work, as do my pet projects
| colesantiago wrote:
| are release notes supposed to be exciting?
| xwdv wrote:
| Usually they fill me with dread.
| staticassertion wrote:
| I think they mean "no longer excites me, in a good way"
| umvi wrote:
| At first I didn't like Go because I thought it was too
| opinionated. But the more I used it, the more I found the tooling
| to be just heads and shoulders above similar languages like
| C/C++.
|
| I use VSCode a lot, and in VSCode you can press "F12" to jump to
| the location of a function definition. In Go I find myself deep
| diving into github libraries all the time just because F12 takes
| me there. That _never_ happened with C /C++ - the tooling was
| just too disparate and fragile.
|
| My biggest complaint with Go is lack of generics. I mean
| technically you can achieve generics with an unholy empty
| interface/reflection incantation but it's a huge pain compared to
| C++.
| klodolph wrote:
| Yes, I've been using F12 a lot too, just to dive into random
| projects. It's amazing how much this little feature means.
| ggregoire wrote:
| Have you tried "F2" (rename symbol)? It's amazing, it's like a
| "safe" find & replace all.
| throw149102 wrote:
| I hate to be "that guy", but you should try Rust. It also has
| amazing tooling, and is probably more comparable to C/C++,
| considering you don't have to use a garbage collector in Rust.
| asadawadia wrote:
| why though? some perf gains?
| DenseComet wrote:
| Go isn't low level in the same way that Rust is. Both
| languages have their places, but Go seems to be more of a
| better Python/JS, whereas Rust is a better C++.
| candiddevmike wrote:
| Generics are hopefully coming February 2022 with 1.18.
| xwdv wrote:
| This will be when I finally use Go for something then.
| nappy-doo wrote:
| Important note: it's the preview release. Not everything will
| be done, there will be gaps. But the first parts of the work
| have already merged to master, and it's coming.
| The_rationalist wrote:
| If your reference point is C/C++ then sure.. Go is a progress,
| but give more modern languages a try, like Kotlin, they sure
| are a major ergonomic and featureful evolution over go
| nestorD wrote:
| That's the sad truth. Go is not leap and bound better on that
| front, it is C/C++ that has not catched up.
| skybrian wrote:
| Apparently type parameter compiler work was supposed to get
| merged just after 1.17. [1] Does anyone know if it's still on?
|
| [1] https://groups.google.com/g/golang-
| dev/c/U7eW9i0cqmo/m/ffs0t...
| 4ad wrote:
| It's already in, it has to be requested by the user with
| `-gcflags='-G=3'`. Of course, the feature is in heavy
| development and not ready for production use, YMMV.
| nappy-doo wrote:
| The merge has already happened. The generic preview is going to
| be in 1.18 (early 2022).
| 37ef_ced3 wrote:
| My appreciation for Go has been monotonically increasing for
| years.
|
| The more Go code I write, the more I like the language, the
| tools, and the standard library.
|
| Low-friction, high-quality software development.
|
| If only I could use it professionally, instead of C++.
| harikb wrote:
| > Module authors may deprecate a module by adding a //
| Deprecated: comment to go.mod, then tagging a new version. go get
| now prints a warning if a module needed to build packages named
| on the command line is deprecated.
|
| Very good for the ecosystem. Nudge folks to upgrade from
| broken/insecure versions
| zz865 wrote:
| Anyone seen jobs for business applications? Go seems to have a
| sweet spot for systems. I'd like to replace Java at my work but
| no one else is doing it.
| pgwhalen wrote:
| I use (and enjoy using) both Go and Java at work, and Go is in
| my opinion very much a Java replacement more than it is, say, a
| Python or C++ replacement. It is absolutely suitable for
| business logic, and I've never been quite sure what its
| designers mean when they say it's a systems language. Yes, you
| can squeeze great performance out of it, but you can with Java
| as well.
|
| The way I see it, both Go and Java are crawling towards the
| same ideal: a compiled, statically typed, garbage collected,
| modern enough program language targeted for a majority of back-
| end concerns. Go has to close the gap mostly just with
| generics; and Java with memory layout (Valhalla), concurrency
| (Loom), and ergonomics (Amber); but they will both be there in
| 3-5 years.
|
| Take this with a grain of salt if you like, but while I
| probably find it more fun to program in Go, I don't think
| there's a compelling reason to switch a large codebase from
| Java to Go. It often feels like my company is needlessly
| divided by programming languages even though they solve fairly
| similar problems. It's one thing to move off of a dying
| language, but Java is certainly not that.
| debarshri wrote:
| When I used to work for traffic enforcement company, their
| whole backend was written in golang.
| jdavis703 wrote:
| While we're not building a "business" application we are
| building a large web application on Go. It's definitely not
| just for systems work.
| leo_bloom wrote:
| > We've also introduced pruned module graphs in this release.
| Modules that specify go 1.17 or higher in their go.mod file will
| have their module graphs include only the immediate dependencies
| of other Go 1.17 modules, not their full transitive dependencies.
|
| This is a very welcome change and make the go.mod much more
| obvious to understand. Hooray!
| [deleted]
___________________________________________________________________
(page generated 2021-08-16 23:00 UTC)