Hacker News new | ask | show | jobs
by runarberg 2271 days ago
Thanks for the comment. This project was previously called Ascii2MathML and I tried to stay as true to the original AsciiMath language as possible. But I’ve since then moved away from it (which is why I renamed it to mathup) as I found it could be improved upon in some minor ways (personal preference really).

There are some trivial differences: e.g. `bf` for boldface instead of AsciiMath’s `bb`; or the `.^` infix for overscripts instead of the `over` prefix. The matrix syntax is also quite different: AsciiMath uses nested brackets, while mathup uses row separators (`;` or `\n`). Most significant is the difference in grammar (you’ve noted the significant white space which is not a feature of AsciiMath).

You can see my attempt of writing down the grammar here[1]. However I’m very much a novice when it comes to compilers and lexical analysis, so this grammar is probably not accurate—in fact when I originally wrote Ascii2MathML I wasn’t even aware that I was writing a compiler. But in words, a set of tokens and operators with no internal white space tends to be grouped together. There are a few infixes (`/`, `^`, `_`, etc.) which generally take precedence but operate on a group of non spaced tokens if they are able to.

I originally wrote this because I wanted people that didn’t necessarily know TeX to be able to drop in a simple expression in comment threads and forums. I also liked to provide as much expressive power as possible, but I found AsciiMath lacking a little in expressiveness. The white space significance I found made writing a little easier, but in longer expressions it is a bit hard to use, but then again, this tool was always intended for smaller expressions anyway.

[1]: https://github.com/runarberg/mathup/blob/master/GRAMMAR