Parsing in C# from first principles
summary
Argues that full parsers fit easily into C# apps and shows code that proves it: writing parser-combinators, using LINQ-style select many composition, and the Superpower library to tokenize and parse. Builds a duration-expression language (numbers, units, + - /, parentheses), adds a now - 7 days construct, and wires an evaluator and tests. Demonstrates readable user errors via token-driven parsing*, and claims real wins — one project’s 18-month form rewrite drops to hours — the parser approach works in practice.
AI-written summary · about
chapters (33)
- 0:00Introduction
- 1:09Dependency Injection
- 3:54Query Design
- 5:25ObjectOriented Programming
- 7:20Trees
- 10:43What is a parser
- 12:14How does a parser work
- 13:39Parse functions
- 16:08Delegate type
- 17:18Many
- 18:44Return function
- 20:16Csharp
- 21:05Return
- 21:37Superpower
- 23:04Magnitude
- 26:24Durations
- 27:37Testing
- 29:26Passing operators
- 33:34Semantics
- 39:02Token Driven Passing
- 39:22Character Stream
- 39:46Tokenization
- 41:48Tokenizer
- 44:25Factor
- 45:02Example
- 46:58Token parsing
- 48:10Token keyword
- 49:11Token match
- 52:42Subtract
- 54:20Text parsers
- 54:57Recap
- 55:37Sbrocco
- 56:22Limitations
related talks
52mBuilding a parser in C#, from first principles
53mUnderstanding parser combinators: a deep dive
01h 27mBoost.Parser (Part 1 of 2) - A Parser Combinator Library for C++
32mTime flies like an arrow; Fruit flies like a banana: Parsers for Great Good
29mMy Little Parser: Tooling is Magic
37mThe Art of Parsing
01h 01mExpressive Compile Time Parsers
26mParser Combinators in Swift
