HackerTube

THE VIDEO SHELF · lexical scanning

Lexical Scanning in Go - Rob Pike

Rob Pike shows how the Go text/template lexer is built, using state functions, goroutines and channels. The talk was given at a Google Technology User Group in Sydney in 2011.

Why HN readers recommended it

HN returns to it for years as an elegant introduction to writing a lexer that is easy to follow even without a parsing background.

This is a summary from the source dataset, not an endorsement by Hacker News or the video creator.

Video & recommendation details

Creator / channel
GoogleFOSSSydney
Topic
lexical scanning
Format
talk
Level
intermediate
HN recommenders in dataset
13
HN mentions in dataset
20
Recommendation years in dataset
2012–2025

These counts and years describe the included Hacker News records; they are not YouTube views or the video’s publication date.

From the original HN conversations

Excerpts from the recorded comments. Follow each source for the full comment and surrounding discussion.

  • Personally, I have a penchant for writing my own pull parsers. Its a mind-expanding exercise. The neat thing about Go is that parsers can return functions that consume the next token. Rob Pike has an excellent video about this: [VIDEO]

    willvarfar on Hacker News · 2012-06
    In Parsing huge XML files with Go
  • Rob Pike did a really good talk entitled 'Lexical Scanning In Go'[0], which covers how the lexing for text/template works. It's far more interesting than it sounds, and even if you don't know much about lexing/parsing it's easy to follow. [0] [VIDEO]

    TomNomNom on Hacker News · 2014-05
    In Templating in Go
  • Lexical Scanning in Go by Rob Pike [VIDEO] I love everything about this talk. It walks you through building a lexer from scratch in a simple and elegant way, through a very interesting use of coroutines. I appreciate the bits of humor in the talk …

    grose on Hacker News · 2016-10
    In Ask HN: What's your favorite tech talk?

Summaries, classifications and recommendation records are from the HackerTube source dataset. Read about this library and its limitations.