Hacker News new | ask | show | jobs
by jonbodner 2848 days ago
Hi, I'm the presenter AMA.

One general comment; not every question was intended as a WAT. Some were setups to introduce a WAT.

2 comments

"The default type (used for inference) for an int constant is int, which is a 32-bit type" -- this is not true, the size of int is platform-defined. See https://golang.org/ref/spec#Numeric_types. The error you're seeing is because on 32-bit platforms where int is 32 bits, 2^64-1 does not fit an int, and on 64-bit platforms where int is 64 bits, 2^64-1 does not fit an int either (int's are signed). This will work on 64-bit platforms though:

  a := math.MaxInt64
  fmt.Println(a)
Unfortunately, the transcription doesn't match what I said. The video is now available at https://youtu.be/zPd0Cxzsslk
At first I was wondering, what is this? Anyone with a Comp Sci degree who read the docs should already know most of this! Then I thought, "This is one of the best stealth Go basic Comp Sci education presentations I've seen in awhile!"