Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Fifteen years later, the Apple Cards origin story (lexontech.org)
    2comments
  2. Breaking Up with Google Play: Why Conversations Is Now Free (gultsch.de)
    —discuss
  3. Revealing the details of how OpenAI agents hacked Hugging Face (swarmtraces.org)
    318comments
  4. One Month Without AI (bustikiller.com)
    10comments
  5. We're gonna need a lot more mathematicians (terrytao.wordpress.com)
    203comments
  6. Floci: Locally emulating any cloud service (floci.io)
    5comments
  7. A single function Jev-like wrapper for LLMs, including vision models (allanrbo.blogspot.com)
    23comments
  8. Plan mode is dead (aymannadeem.com)
    325comments
  9. Ollaya – Ollama for open-source, Jev-style decision models (ollaya.dev)
    118comments
  10. Is your Postgres migration safe or not safe? (safenotsafe.dev)
    10comments
  11. Show HN: Jev Plays Pokémon Red (jev-pokemon.vercel.app)
    87comments
  12. What even is an OS now? (sockpuppet.org)
    292comments
  13. Parsing Expression Grammar vs. Regexes: Building Org Parser in Lisp, Export HTML (jointhefreeworld.org)
    1comments
  14. The Murky History of Soviet-Born Tetris (mitpress.mit.edu)
    13comments
  15. 16GB iPod Nano 3G Upgrade (tuckerosman.com)
    3comments
  16. Gravity seems holographic. What does that mean for reality? (quantamagazine.org)
    176comments
  17. Scientists build most accurate atomic clock (phys.org)
    6comments
  18. Jury finds Facebook liable for deceiving users in Cambridge Analytica case (cbsnews.com)
    60comments
  19. Ask HN: Who's still keeping a DOS machine up because the business depends on it?
    135comments
  20. From Thin Air to Bootable Images: The Tine Build System (amutable.com)
    1comments
  21. Fourier Analysis: Drawing Llamas with Circles (adekau.github.io)
    5comments
  22. A new world airport and its baggage (computer.rip)
    1comments
  23. Excel now supports multiple values in a single cell (techcommunity.microsoft.com)
    144comments
  24. First Principles Thinking (sunilsadasivan.com)
    112comments
  25. Lab on a Contact Lens Can Measure Stress Through Serotonin (ieee.org)
    12comments
  26. Show HN: Hacker Atlas - A map of what Hacker News talks about (hackeratlas.com)
    21comments
  27. I wrote a ray tracer in Brainfuck (epestr.com)
    18comments
  28. HomelabFest will be in St. Louis in September 2027 (homelabfest.org)
    20comments
  29. One Piece of Flock Camera Data Put This Innocent Woman in Jail for 13 Days (jezebel.com)
    89comments
  30. Remembering Johannes Doerfert (llvm.org)
    3comments

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

34 pointsby 1d agojointhefreeworld.org
1 comments
33m agoHN ↗

Ha, that's interesting.

I started exactly such a project, for org syntax, a while ago. Didn't get very far though because it seems to me that things in org cannot be parsed and understood in one go. For example the TODO keywords can be specified at the top of an org file and then would influence how headings in the document are understood. This cannot be done with merely a PEG.

Another tricky point is nested inline markup. Bold inside italic? Verbatim inside bold, inside italic? And so on. Would be great to support all meaningful combinations via recursive rules. Org has many inline markup things. Even programming language specific inline markup elements.

Another issue is, that Guile's PEG library, when using the non-string form of grammar rules, does not allow mutually recursive grammar rules, due to being buggy (in that way it is not excellent, but in other ways it is!). One has to use the string form or rules, which makes it a lot less nice to use, unfortunately. I hope that will be fixed at some point, because I like the library except for that. And it is in the standard lib, no need to install any dependencies. Like to use it for AoC puzzle inputs for example.

Will be interesting to read how far they got.