‹ BackHN Continuity

Thread

Parsing Expression Grammar vs. Regexes: Building Org Parser in Lisp, Export HTML

126 points · 20 comments · jjba23

  1. remywang · · focus · HN ↗
    One cool factoid about PEGs is that it is an open problem if they can parse all context free languages.
    1. pcfwik · · focus · HN ↗
      If I understand correctly, one of the recent cool generative AI-assisted results is actually supposed to have closed this problem, complete with a Lean proof!

      <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2608.29592" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2608.29592

    2. torginus · · focus · HN ↗
      I think language designers in general have realized that there&#x27;s nothing particularly virtuous about a programming language with a syntax that&#x27;s hard to parse.

      Go and Rust (and Pascal) have cleaned up C&#x27;s awful legacy enough that they&#x27;re parseable with LL(X) parsers that don&#x27;t have scary corner cases or polynomial behavior.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.