Here's a list of some changes to look forward to in #golang 1.18! The first beta should be out in a month, and the final release in three months.

Each change with a link, so you can read more.
Of course, generics, also known as type parameters! Work started about two years ago, and the language changes are finally landing.

Full details here: go.googlesource.com/proposal/+/ref…
Only overshadowed by generics is native support for fuzzing! @dvyukov led the way with go-fuzz for many years, and @katie_hockman with @jayconrod brought native support for "go test".

go.dev/blog/fuzz-beta
Module workspaces are a significant addition by @matloob, making it easier to develop multiple modules locally at once. Until now, this required adding temporary replace directives.

github.com/golang/go/issu…
The build process is also getting many quality of life improvements. By default, binaries get stamped with VCS information, such as git's current tag or HEAD commit!

github.com/golang/go/issu…
Binaries also include build parameter details by default, such as what build tags or compiler/linker flags were used, or whether cgo was enabled.

You can now read all this info without having to use "go version -m", via the new debug/buildinfo package!

github.com/golang/go/issu…
"go mod download" is now more conservative, downloading fewer modules into the cache. For instance, indirect dependencies not actually needed for the build are now omitted by default.

github.com/golang/go/issu…
The GC is getting a pacer redesign by @mknyswe - the pacer being what decides when a new GC cycle should run.

Hard to summarize in a tweet, but it looks like a worthwhile incremental change. Lots of detail in the full proposal text.

github.com/golang/go/issu…
The toolchain now supports optimizing for newer x86-64 machines via GOAMD64!

You should consider the portability tradeoff for this knob. But if you target x86-64-v3 machines like servers, you could see single-digit-percent perf improvements.

github.com/golang/go/issu…
Binary sizes, you said? @commaok at @Tailscale has been busy this cycle, and it seems like binaries could get a few percent smaller!

go-review.googlesource.com/c/go/+/352110
go-review.googlesource.com/c/go/+/352191
go-review.googlesource.com/c/go/+/351463
Speaking of Tailscale, @bradfitz brought the new net/netip!

Its newer design brings many quality of life improvements, and also fewer allocs.

github.com/golang/go/issu…
And, on the topic of quality of life improvements, we're getting strings.Cut to simplify most uses of strings.Split!

github.com/golang/go/issu…
Finally, one change I've been working towards for a while is parallelizing gofmt. On my laptop, formatting a large project is now over three times faster!

github.com/golang/go/issu…
These are my personal picks - what are yours? #golang, did I miss anything particularly exciting?

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Daniel Martí

Daniel Martí Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @mvdan_

21 Jan
Here's a short list of the changes to look forward to for #golang 1.17, to start landing once the merge window opens in a few weeks.

Don't get confused with 1.16, releasing next month. 1.17 will come out in seven months.

Each change with a link, so you can read more.
A register-based calling convention for Go functions. Backwards compatible, and should give 5-10% speed improvements across a range of applications.

github.com/golang/go/issu…
First class fuzzing support in the Go toolchain. This work has been happening behind the scenes in the dev.fuzz branch for some months, so I hope it will start landing for 1.17.

golang.org/s/draft-fuzzin…
Read 8 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(