Guido van Rossum

medium.com/@gvanrossum_83706 · Personal blog · on HN since 2019

Guido van Rossum, creator of Python, wrote a Medium series on building PEG parsers, including left recursion and the parser for CPython.

What HN saysCommenters recommend the series for PEG parsing and memoizing left recursion, though one notes some Medium articles are now behind a paywall.
18HN people shared it
6linked it in comments
19stories submitted
266story points
10 months agolast shared
2019people per year2026

Most-shared posts

  1. 1
    Peg Parsing Series Overview (2019)
    8 people · 33 points · first shared 2019 · 5 comments on HN
  2. 2
    PEG Parsers
    4 people · 157 points · first shared 2019 · 49 comments on HN
  3. 3
    Left-Recursive Peg Grammars
    2 people · 52 points · first shared 2019 · 6 comments on HN
  4. 4
    Building a Peg Parser. Part 2
    2 people · 9 points · first shared 2019 · discussion on HN
  5. 5
    Visualizing PEG Parsing
    2 people · 5 points · first shared 2019 · discussion on HN
  6. 6
    Adding Actions to a Peg Grammar
    2 people · 4 points · first shared 2019 · discussion on HN
  7. 7
    Generating a PEG Parser
    1 people · 3 points · first shared 2019 · discussion on HN
  8. 8
  9. 9
    A Meta-Grammar for Peg Parsers
    1 people · 1 points · first shared 2019 · discussion on HN

What HN people wrote when they linked it

mekoka · 2020-10-30
I don't even know if some of the authors are aware that their contents are now behind a paywall. Yet, people keep recommending those articles as if they're openly accessible (because for some reason they have access). Yesterday someone linked to this series from Guido van Rossum https://medium.com/@gvanrossum_83706/peg-parsers-7ed72462f97c. I opened and was greeted with this message: Not every story on Medium is free, like this one. Become a member to get unlimited access and support the voices you want to hear more from. Upgrade Read any story. Access everything on Medium across all your devices with no limits or ads. Reward great writing. A portion of your membership fee will go toward the writers you read most. Considering the author you have to wonder.
ben509 · 2020-10-22
I'm not entirely settled on that. My working approach is if you're writing a compiler, it wants to have an unambiguous grammar and shouldn't even attempt recovery. If input doesn't parse, the compiler can recommend (or just run) the linter. That keeps the common case fast and simple. The linter/fixer can have a relaxed syntax specifically designed to handle messy code and suggest corrections. That comes from a philosophy of treating error correction and user assistance as a separate task. But that's an approach I'm taking because I want to get a reference implementation together as quickly as possible. It's definitely not how modern IDEs work. JetBrains GrammarKit uses a PEG[1] because they need strong support for error recovery[2] using hints. Another interesting library is Tree-sitter[3]; it does incremental parsing keeping an AST constantly up to date for you. Relevant to this whole discussion, GvR wrote a series on PEG parsers[4] in which he starts out by writing one by hand and then shows how to write one that accepts a grammar. [1]: https://github.com/JetBrains/Grammar-Kit [2]: https://github.com/JetBrains/Grammar-Kit#attributes-for-error-recovery… [3]: https://tree-sitter.github.io/tree-sitter/ [4]: https://medium.com/@gvanrossum_83706/peg-parsing-series-de5d41b2ed60
Porygon · 2025-12-30
Memoization to limit left-recursive recursion is nicely described in Guido van Rossums' article here: https://medium.com/@gvanrossum_83706/left-recursive-peg-grammars-65dab… I recently tried that approach while simultaneously building an abstract syntax tree, but I dropped it in favor of a right-recursive grammar for now, since restoring the AST when backtracking got a bit complex.
sleavey · 2020-10-27
Guido van Rossum talks about this in his series on designing a PEG parser for Python [1], now used in 3.9. [1] https://medium.com/@gvanrossum_83706/peg-parsing-series-de5d41b2ed60
kissgyorgy · 2019-09-30
If you found this article interesting, you might find interesting Guido's blog post series about PEG parsers: https://medium.com/@gvanrossum_83706/peg-parsing-series-de5d41b2ed60

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close