~/talk

Numbers

Talkat GopherCon UK 2026 · 2026-08-12..08-13· [go]
links:none on file
slides:none on file

Rob Pike's quip that "numbers are just numbers" means Go treats numeric literals as untyped constant literals so 1<<32 or 10_000_000_000 never silently overflow like in C where 1<<32 can be undefined and 2.1 billion wraps or signed/unsigned promotion turns -1 into a huge value. Go either accepts the literal for the target type or produces a compile-time error. The compiler keeps literals with a 512-bit internal representation so the same source runs everywhere, even on an 8-bit Arduino via TinyGo.

AI-written summary · about

  1. 0:00Introduction
  2. 1:08Go lacks unsigned literals
  3. 13:51Computing word sizes history
  4. 14:11Literal constants complexity
  5. 16:21BCPL and C’s types
  6. 19:49Word to byte addressing
  7. 21:14C’s integer types history
  8. 23:01Undefined behavior in C
  9. 27:10C’s integer literal problems
  10. 29:16Go’s numeric constants solution
  11. 33:11Go’s numeric constants work
  12. 34:12Least surprise in Go
  13. 34:39Q&A
~/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.