Understanding parser combinators: a deep dive
summary
Builds a tiny parser-combinator library in F# from scratch (about 500 lines total) that exposes basic combinators: sequence, choice, map, many/optional and helpers for labelled errors and line/column tracking. Uses those to implement a full-featured JSON parser (about JSON parser 295 lines), including strings, numbers, arrays, objects, booleans and null, with backtracking and readable error messages; demo shows it parses real JSON and reports exact failure locations, though it is not optimized for speed.
AI-written summary · about
chapters (23)
- 0:00Intro
- 1:47Outline
- 2:21What is a Combinator
- 3:50Why parse
- 5:15Simple parser
- 13:48Combinators
- 14:51Map Combinator
- 17:32Fix Operators
- 18:08Demo
- 20:54Compound Combinators
- 24:56Parsing
- 26:31More combinators
- 30:50Improving the parser
- 33:34Building a JSON parser
- 34:52Null
- 36:49Strings
- 38:22List of passes
- 40:17Unicode character
- 42:00Integers
- 44:36Combine
- 45:00Parse
- 50:13Summary
- 52:21Outro
related talks
41mParser Combinators
26mParser Combinators in Swift
52mBuilding a parser in C#, from first principles
15mStaged Selective Parser Combinators
01h 48mBoost.Parser (Part 2 of 2) - A Parser Combinator Library for C++
58mParsing in C# from first principles
09mScala Parser Combinators: The Easier Way to Create an External DSL
01h 10mParsing from first principles
