Comment by tgbugs

13 hours ago

This is incorrect. You can write a parser for org. See for example https://github.com/tgbugs/laundry. Work toward standardization has been stalled because I (among others) have not had time to circle back to work on it. In part this is because the lack of a standard has not blocked most use cases since emacs is open source and can run almost anywhere.

> You can write a parser for org. See for example https://github.com/tgbugs/laundry.

Oh, there are a lot of incomplete parsers. This one is not an exception:

> Status

> Laundry can parse most of Org syntax, though there are still issues with the correctness of the parse in a number of cases.

> In particular there are a number of edge cases in the interaction between the syntax for various Org objects that have not been resolved.

I have my own parser as a pest grammar. It has just the basic features. This Laundry seems to implement more of org-mode, but I don't care anymore really, because I believe that org-mode will not be reimplemented.

> In part this is because the lack of a standard has not blocked most use cases since emacs is open source and can run almost anywhere.

I have some inexplicable aversion to an idea starting elisp interpreter just because my program needs org-mode parser. But even if I could integrate elisp into my program as easy as I do with lua, I probably wouldn't do it, because parser in lisp doesn't really solves the problem, it simplifies it a bit (I don't need to deal with the grammar) but shifts to another level: I need to learn how org-mode is represented as a lisp object. I need to reverse engineer the formal definition of that recursive object to deal with it, or turn on defensive programming expecting anything.

The only realistic way of dealing with org mode is to write code for emacs. There are exceptions of this rule, like pandoc, but I don't trust them.

> Work toward standardization has been stalled because I (among others) have not had time to circle back to work on it.

I tried to not to react to this, but, I'm sorry, I'm too much of a troll to just leave it without commenting.

Of course you have no time to write a formal definition. No one has time for that, and no one will have time for this. Because at this stage it is practically impossible. The parser was written as a bunch of regexps intermixed with lisp code. All edge cases were baked into org-mode because those regexps are the definition of org-mode. To write a formal grammar you need to catch all those edge cases, and to reproduce the behavior of the existing parser.

In retrospect, the parser should've been replaced with a formal grammar definition at much earlier stage, when it was possible to replace parser with another one, which is similar but generally incompatible because it deals with edge cases in a different ways. When the time was missed those edge-cases became a legacy you cannot fix.