Daniel Martí Profile picture
May 5 20 tweets 6 min read
Here's a list of some changes coming in #golang 1.19! The first beta will be out in a month, and the final release in early August.

Live tweeting from @GolangSheffield! Each change with a link, so you can read more.
1.18 shipped generics, which made it a large release that arrived six weeks late.

This means 1.19 got less development time than usual, to be able to release on time. The feature freeze is this week.
Starting out, lots of fixes and tweaks for type parameters AKA generics!

Some are being backported to Go 1.18, and some are still in progress. Overall, more polish.
What about major features?

First, runtime.SetMemoryLimit to provide the garbage collector with a soft memory limit!

Similar to GOGC, but based on total size rather than a percentage. github.com/golang/go/issu…
The runtime now increases the limit of open files!

On some Linux systems, the default "soft" limit is 1024, but can be increased up to the "hard" limit.

github.com/golang/go/issu…
The race detector is now 2-10x faster than before, thanks to ThreadSanitizer's new v3 runtime!

github.com/golang/go/issu…
We have a new Address Sanitizer with -asan, a new companion to -race and -msan!

It can catch some classes of memory errors, especially when handling memory manually via CGo.

github.com/golang/go/issu…
The net package now uses EDNS to increase the DNS packet size, to adhere to modern DNS standards and implementations.

This should help with problems with some DNS servers.

use EDNS to increase DNS packet size - github.com/golang/go/issu…
The "unix" build tag now exists, so no more "// +build darwin dragonfly freebsd linux netbsd openbsd solaris"!

Note that "*_unix.go" is not recognized, for backwards compatibility with existing files.

github.com/golang/go/issu…
os/exec now consistently sets the PWD environment variable to avoid confusion.

This also means a new Cmd.Environ method to get the applied environment.

github.com/golang/go/issu…
What about the standard library?

Starting with flag.TextVar, which allows making a flag out of any encoding.TextMarshaler and Unmarshaler!

github.com/golang/go/issu…
net/url also gains JoinPath, akin to path.Join but without breaking "//" in URLs.

github.com/golang/go/issu…
time.Duration gains an Abs method, to make some time comparisons easier to write.

github.com/golang/go/issu…
encoding/binary gains AppendByteOrder, to encode integers in the "append" style.

This can be more convenient, by not needing an extra temporary buffer.

github.com/golang/go/issu…
Similarly, encoding/binary also gains AppendVarint and AppendUvarint.

github.com/golang/go/issu…
To round off the list, performance!

Big map literals are now initialized much faster than before, saving time when their code is run.

github.com/golang/go/issu…
The compiler now propagates more variables that it can prove to have a constant value.

This makes the Go binary 0.04% smaller, and should produce marginal speed gains.

go-review.googlesource.com/c/go/+/403735
bytes.Buffer now grows more efficiently, thanks to the "append" builtin.

github.com/golang/go/issu…
reflect.Value now allows calling the Bytes method on addressable byte arrays.

Before, one had to use the Slice method, which allocates.

github.com/golang/go/issu…
And finally, io's MultiReader and NopCloser now forward WriteTo method calls.

github.com/golang/go/issu…
github.com/golang/go/issu…

• • •

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_

Nov 6, 2021
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
Read 14 tweets
Jan 21, 2021
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

Don't want to be a Premium member but still want to support us?

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

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(