Learning Go, 2nd Edition and upcoming language changes

1,062 views
Skip to first unread message

Jon Bodner

unread,
Jan 2, 2023, 10:20:38 PM1/2/23
to golang-dev
Hi all,

I'm in the middle of updating Learning Go from O'Reilly (https://learning.oreilly.com/library/view/learning-go/9781492077206/). The target release date is the end of this year and I wanted to make sure that I covered any language or library changes that can be expected through Go 1.22. 

I have already incorporated changes that are coming in 1.20, but didn't know which of the following I can expect in the next year or so:

- new for/range loop behavior 
- structured logger in standard library
- go.mod go declaration affecting compiler used on a per-module basis, possibly downloading new versions
- generics libraries moving from exp to standard library 
- iterators
- set type
- official arena allocator support
- only the struct literal with keys is legal outside of the package where a struct is declared 
- official support for profiles driving compiler optimizations
- is there anything I've missed?

I certainly don't expect a promise that a feature will or will not be added, but anything that can help keep the next edition of the book up-to-date would be greatly appreciated.

Also, I'm always looking for additional technical reviewers. If anyone is interested, please reach out to me!

Thanks,

Jon
 

Ian Lance Taylor

unread,
Jan 2, 2023, 10:28:54 PM1/2/23
to Jon Bodner, golang-dev
On Mon, Jan 2, 2023 at 7:20 PM Jon Bodner <j...@bodnerfamily.com> wrote:
>
> I'm in the middle of updating Learning Go from O'Reilly (https://learning.oreilly.com/library/view/learning-go/9781492077206/). The target release date is the end of this year and I wanted to make sure that I covered any language or library changes that can be expected through Go 1.22.
>
> I have already incorporated changes that are coming in 1.20, but didn't know which of the following I can expect in the next year or so:

It's a hard question to answer. Most of the things you mention are
proposals that haven't been accepted yet. I can say what I hope will
happen, but honestly most of these are undecided.

> - new for/range loop behavior

I hope this will get in, but I don't know whether it will.

> - structured logger in standard library

I hope this will get in, and I think it's fairly likely.

> - go.mod go declaration affecting compiler used on a per-module basis, possibly downloading new versions

I hope this will get in, but I don't know whether it will.

> - generics libraries moving from exp to standard library

I think this is moderately likely at least for slices and maps.

> - iterators

Really hard to say.

> - set type

Hard to say. There isn't even a solid proposal for this at the moment.

> - official arena allocator support

Doesn't seem very likely at this point.

> - only the struct literal with keys is legal outside of the package where a struct is declared

I think "go vet" already applies this rule. I have no idea whether it
will become part of the language proper.

> - official support for profiles driving compiler optimizations

I think this one is pretty likely to get in.

Of course I could be wrong about any of this. No promises.

Sorry that's probably not too helpful.

Ian
Reply all
Reply to author
Forward
0 new messages