Skip to content
0:00 / 0:00

#parsercombinators#f##jsonparser

Understanding parser combinators: a deep dive - Scott Wlaschin

NDC Conferences

230K subscribers • 110 videos on Hallway • Conference channel

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • A classic. People kept recommending it from 2017 to 2021.
  • Presented by Scott Wlaschin

Intermediate. Assumes working knowledge.

43K views10 years ago2 recommendations

Programming languagesComputer scienceFunctional programmingCompilers and interpretersAlgorithms

Scott Wlaschin builds a parser combinator library from scratch in F# and uses it to implement a JSON parser.

Traditionally, writing parsers has been hard, involving arcane tools like Lex and Yacc.An alternative approach is to write a parser in your favourite programming language, using a "parser combinator" library and concepts no more complicated than regular expressions. In this talk, we'll do a deep dive into parser combinators. We'll build a parser combinator library from scratch in F# using functional programming techniques, and then use it to implement a full featured JSON parser. NDC Conferences ndcoslo.com ndcconferences.com

Why it's here

2 people recommend this

What people say. Recommended as an excellent, practical introduction to parser combinators that makes the concept click for developers.

u/maanloempiain r/ProgrammingLanguages • Recommends

On “Anybody have tips for writing a Recursive Descent Parser for an AST? [ JS ]”

I wrote my first recdec parser by hand. It was a massive `switch` statement with countless `if`s checking wether the lookahead token was what the parser expected. At some point I could no longer understand anything I'd done. I wouldn't recommend the following to just anyone, but it certainly made parsing _click_ for me: check out parser combinators. It's a functional pattern where you describe any language using tiny little functions that you combine (hence combinators) into bigger functions that describe productions in your grammar. Here's a parser combinator tutorial that helped me a lot. It's in typescript though, but I would really urge anyone to use typescript over javascript. [This…

u/know_not_muchin r/scala • Recommends

On “Sources for compiler plugins writing?”

This is one source to get started. link to this video