rasendubi / uniorg

An accurate Org-mode parser for JavaScript/TypeScript
https://oleksii.shmalko.com/uniorg
GNU General Public License v3.0
256 stars 24 forks source link

Comparison with Orga #100

Closed josephmturner closed 7 months ago

josephmturner commented 7 months ago

Hello! Would you describe the key differences between uniorg and Orga?

At a glance:

See https://github.com/orgapp/orgajs/issues/232

rasendubi commented 7 months ago

Hey. I think the main difference is the approach to parsing

Orga implements the parser from scratch using “proper” parsing techniques. This should (theoretically) result in a faster parser and a cleaner code. The main issue with this approach is that Org syntax is notoriously convoluted and was not designed with traditional parsers in mind. Thus, Orga and every other parser based on this approach fail to catch all the complexity of the syntax and often produce incorrect results or crash. (Although they work for most simple cases.)

Uniorg started after I tried Orga for my website and it completely failed to parse a good chunk of my notes and produced incorrect results for many others. Uniorg, therefore, prioritizes accuracy of parsing and compatibility with org-mode over ease of implementation or “best practices.”

Uniorg is almost a direct translation of org-element.el—an official org-mode parser written in Emacs Lisp (which is a part of org-mode package). Therefore, Uniorg has the same license as org-mode (GPL). It uses a regex-based parsing approach (which is generally considered bad and slow), the parser is not pretty and is a messy soup of regexes but it works and is probably the most accurate org-mode parser there is.

josephmturner commented 7 months ago

Thank you @rasendubi!! Your explanation is clear and thorough :)