Syntaxation
summary
Argues that syntax is overrated and demonstrates a working JavaScript parser built with top-down operator precedence, using a symbol table, tokens with nud/led handlers, numeric binding powers, infix/prefix/fud helpers, and a single expression loop that yields an AST. Shows it handles precedence, left/right associativity, statements, assignments and can run fast enough as an interpreter, support extensible DSLs, eliminate reserved words, and produce semicolon-free grammars; points to simplified JavaScript and JSLint implementations on GitHub.
AI-written summary · about
chapters (14)
- 0:00Introduction to Syntax
- 1:49Syntax vs. Language Design
- 5:05Minimalist Syntax Examples
- 6:14Evolution of 'if' Statements
- 10:25Syntactic Regression in C
- 13:20The Danger of Ambiguity
- 19:12Top-Down Operator Precedence
- 22:47Implementing the Parser
- 26:40Defining Operators and BNF
- 31:10Parsing Statements and Blocks
- 35:04The Core Parsing Algorithm
- 37:20Benefits of Pratt Parsing
- 39:27Advice for Language Designers
- 47:50Q&A and Final Thoughts
related talks
29mMy Little Parser: Tooling is Magic
44mJavaScript AST programming: Introduction and beyond
45mHow to Make a Programming Language
31mTime flies like an arrow, fruit flies like a banana
36mMythical trees and where to find them
20mWriting a Compiler in Node.js using Streams
32mTime flies like an arrow; Fruit flies like a banana: Parsers for Great Good
18mThe Ultimate Conditional Syntax
