~/talk

The Why of Iterator Design

Talkat GopherConAU 2024 · 2024-11-06..11-08· [go, compilers-and-language-design]
links:none on file
slides:none on file

Go 1.23 adds user-defined iteration that integrates with range by accepting functions not interfaces, not by adding a new iterator method. The standard iter package exposes seek/seek2 (push-style generators) and helper pull/pull2, with generator functions receiving a yield(value) bool callback; the optional bool was dropped and compiler rewrites yield in place. Compatibility and stop/cleanup concerns drive the choice, and the design is implemented in the compiler and standard library.

AI-written summary · about

  1. 0:00Introduction and context
  2. 2:50Why this talk exists
  3. 4:34History of iteration in Go
  4. 9:51Original iterator proposal
  5. 17:12Problems with the proposal
  6. 21:06Revised design and changes
  7. 25:21Final language changes
  8. 28:00Conclusion and summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.