Parsing Expression Grammar vs. regexes: Building Org parser in Lisp that exports to HTML (via SXML)
18 points by jjba23
18 points by jjba23
Great work!
This is effectively alternative Org implementation, and I'm sure would be useful to make sure Org spec is complete and correct. There are couple of other implementations too (Organics uses one in js, and another one I keep forgetting), but PEGs are much easier to grok.
Thanks! I'm gonna keep an eye on this project, very interesting stuff.
Pandoc has an implementation in Haskell I believe too.
Very much agree that having a PEG for Org is much appreciated. I made 3/4 of a parser/roundtrip loader+AST+writer in Elixir a long time ago and it was quite painful due to the lack of a formal spec of some kind. PEG grammar like this project is doing would be good, BNF would be good, just... something. I was referring back to the org-mode elisp a fair bit to make sure that the my interpretations of the spec and the elisp actually matched interop behaviour. It was rough.
Pretty brave of you as to go into that path!! Pandoc indeed has a good Org supp and diving into implementation! I really find Org to be underappreciated by many people and it should be more popular than other formats if you ask me with all the great features and sane syntax it has (albeit with many historical legacy)
I do hate to admit that I migrated away from Org in general because I couldn't figure out a good mobile story. I ended up in a situation where I was doing a lot of field work and an iPad was way more convenient than a laptop, or something would happen that deserved a note and there wasn't a good way to keep track of that from my phone (into Org).
I still miss it, but as far as I can tell that story hasn't really gotten much better. Plus Todoist has a much better story for "sharing this todo list with my wife". Some day I'll probably go back to it but probably not until I'm sure I'm not doing field work or a really great mobile Org app comes out.
Thanks for your comment :) it is indeed an alternative Org implementation that for now only has 1 export backend, but this has now some possibilities to render to other things. I am also super happy with how PEG turned out for this and how self documenting and elegant it can be. Hopefully soon I can start getting closer to a compliant implementation