Dan Lentz

+

1

2

1

2

1

Just had a discussion about parsing symbolic algebraic expressions actually:

https://plus.google.com/108620647514621362580/posts/SVaa2KPn48Y

https://plus.google.com/108620647514621362580/posts/SVaa2KPn48Y

Start a hangout

ugh, another idiocy of TeX legacy.

see http://mathquill.com/ it's cool and all, but note the syntax. Quote:

try \sqrt x, try \sin\theta .

when you want square root or sin etc, why cannot we simply write

r = Abs[z] = Sqrt[x^2+y^2]

and let that be the syntax? why the backslash syntax soup?

the damage of TeX, like unix, is deep and pervasive. It's free, like cig given to children, washed people's brain. It's so rooted that people are now saying the web should abolish MathML and let TeX be the standard.

The TeX Pestilence (the problems of TeX/LaTeX)

http://xahlee.info/cmaci/notation/TeX_pestilence.html

#math #latex

see http://mathquill.com/ it's cool and all, but note the syntax. Quote:

try \sqrt x, try \sin\theta .

when you want square root or sin etc, why cannot we simply write

r = Abs[z] = Sqrt[x^2+y^2]

and let that be the syntax? why the backslash syntax soup?

the damage of TeX, like unix, is deep and pervasive. It's free, like cig given to children, washed people's brain. It's so rooted that people are now saying the web should abolish MathML and let TeX be the standard.

The TeX Pestilence (the problems of TeX/LaTeX)

http://xahlee.info/cmaci/notation/TeX_pestilence.html

#math #latex

6

3

28 comments

Dan Lentz

+

1

2

1

2

1

Just had a discussion about parsing symbolic algebraic expressions actually:

https://plus.google.com/108620647514621362580/posts/SVaa2KPn48Y

https://plus.google.com/108620647514621362580/posts/SVaa2KPn48Y

So, your complaint about TeX syntax is that it is not Mathematica? You can't call Mathematica syntax anything but arbitrary either, though it is perhaps closer to equations than TeX is (because Mathematica never had to typeset English too). But a capital S on 'Sqrt' and square brackets where mathematicians would never use them is **every bit** as arbitrary and artificial a choice as TeX syntax.

We get that you don't like TeX, but your only actual argument appears to be that you like Mathematica more.

We get that you don't like TeX, but your only actual argument appears to be that you like Mathematica more.

+Nick Alcock Nick, i hope you are not trolling, and you should at least scan the link i posted.

the gist, is not about Mathematica. You can have any syntax, say this:

r = abs(z) = sqrt(x^2+y^2)

or, use ruby syntax, or Java syntax, or lisp syntax. ALL is better than random soup that position glyph.

TeX is language designed to position glyph, that's called typesetting.

math, formal languages, computer science, computer languages, uses a syntax that has structure.

The TeX Pestilence (the problems of TeX/LaTeX)

http://xahlee.info/cmaci/notation/TeX_pestilence.html

further, the gist in this particular post is that i wanted to convey how already standard arithmetic expressions used in math and basically all computer languages, yet people want to change that to TeX. You say TeX is standard, from what, 20 years ago? How long has computer language arithmetic expression such as sqrt(x^2+y^2) been a standard?

the gist, is not about Mathematica. You can have any syntax, say this:

r = abs(z) = sqrt(x^2+y^2)

or, use ruby syntax, or Java syntax, or lisp syntax. ALL is better than random soup that position glyph.

TeX is language designed to position glyph, that's called typesetting.

math, formal languages, computer science, computer languages, uses a syntax that has structure.

The TeX Pestilence (the problems of TeX/LaTeX)

http://xahlee.info/cmaci/notation/TeX_pestilence.html

further, the gist in this particular post is that i wanted to convey how already standard arithmetic expressions used in math and basically all computer languages, yet people want to change that to TeX. You say TeX is standard, from what, 20 years ago? How long has computer language arithmetic expression such as sqrt(x^2+y^2) been a standard?

Donald Knuth is a brilliant man and I don't feel right calling his invention a pestilence. I prefer to say that it is abused for purposes it was never designed for, like using a screwdriver to pound nails, or using a box cutter to hijack a plane. It doesn't mean they aren't good tools for the right purpose.

Cool, nice idea to make hieroglyphic text easy to input in Manuel de Codage. Same scaling and position problems... ;)

Xah Lee

+

1

2

1

2

1

The finalized version of TeX (TeX3) is more than thirty years old. This is a **feature** maintained with considerable effort, not a bug: it means that old documents continue to typeset exactly as they did before. I don't know why you consider it valuable that mathematics you wrote a decade or two ago can become unreadable (or does twenty-year-old Mathematica still work now? Is that a guarantee? It is with TeX). It may be ugly, but it is **consistent**, and lots of people understand it. You appear to be ignoring this in the belief that you can somehow brainwash the global community of mathematicians into using a new notation controlled by a single corporation (in effect, a single individual: Wolfram's egocentricity and well-documented inability to work with others is such that I doubt that Mathematica will outlive him).

Maths is a millennially ancient, ultra-long-term project. Recommending formats and notations controlled by single companies or individuals, which will die when those companies or individuals die, is foolish in the extreme.

Maths is a millennially ancient, ultra-long-term project. Recommending formats and notations controlled by single companies or individuals, which will die when those companies or individuals die, is foolish in the extreme.

+Nick Alcock addressing some of your points.

* i never discussed about stability issue. It's a issue on your mind. I never claimed anything about Mathematica or TeX being stable or not. But now, on that issue, Mathematica is very conservative. Stephen Wolfram often claimed that M v1 still runs. In my experience, when upgrading v3 (~1998) to v7 (~20011), there's some changes need to be done, but minor, most are auto caught. Mathematica essentially remains compatible.

in general, stability is a broad software issue. Different company takes different approach. Microsoft, Apple (from Mac Classic to OSX, and cpu from Motorola to RISC chip to Intel), and Google (changes every year). And unix in general is the most conservative. And, we have perl 1 to perl 4 incompatible change, python 2 to 3 incompatible change.

So, your claim about TeX being stable, i agree, but is it good or bad, one can't say categorically. One thing about too conservative is that things don't progress. Emacs is a classic example. Do you still want to use the format of floppy disk? or the format in your CD, DVD? or, SGML?

* i never discussed about stability issue. It's a issue on your mind. I never claimed anything about Mathematica or TeX being stable or not. But now, on that issue, Mathematica is very conservative. Stephen Wolfram often claimed that M v1 still runs. In my experience, when upgrading v3 (~1998) to v7 (~20011), there's some changes need to be done, but minor, most are auto caught. Mathematica essentially remains compatible.

in general, stability is a broad software issue. Different company takes different approach. Microsoft, Apple (from Mac Classic to OSX, and cpu from Motorola to RISC chip to Intel), and Google (changes every year). And unix in general is the most conservative. And, we have perl 1 to perl 4 incompatible change, python 2 to 3 incompatible change.

So, your claim about TeX being stable, i agree, but is it good or bad, one can't say categorically. One thing about too conservative is that things don't progress. Emacs is a classic example. Do you still want to use the format of floppy disk? or the format in your CD, DVD? or, SGML?

Xah Lee

+

3

4

3

4

3

+Nick Alcock on your second point, about Mathematica, being a single corp, etc. I don't know why you kept bringing up Mathematica. It's again your bugger that somehow i've lodged on you.

my rant against TeX, has nothing to do with Mathematica. I espouse a syntax that preserve syntactic structural info. I did use Mathematica as a alternative example. But, i've also cited MathML.

I have tried very hard, in this particular post/thread, to bring out a single fact, about syntax. Why can't we have

<render>sqrt(x^2+y^2)/z</render>

or matrix

<render>[[3,4],[5,6]]</render>

and instead TeX induced people to want

<render>\frac{\sqrt \x^2 + \y^2}{z}</render>

<render>\begin{bmatrix} 1 & 2\\ 3 & 4\\ \end{bmatrix} \begin{bmatrix} 0 & 1\\ 0 & 0\\ \end{bmatrix}= \begin{bmatrix} 0 & 1\\ 0 & 3\\ \end{bmatrix}</render>

can't you see, that these are code designed to position symbols, it's not about math anymore. It's about a language that micro position symbols. It's called typesetting.

you never addressed this issue. Again, it's not about Mathematica.

http://xahlee.info/cmaci/notation/TeX_pestilence.html

my rant against TeX, has nothing to do with Mathematica. I espouse a syntax that preserve syntactic structural info. I did use Mathematica as a alternative example. But, i've also cited MathML.

I have tried very hard, in this particular post/thread, to bring out a single fact, about syntax. Why can't we have

<render>sqrt(x^2+y^2)/z</render>

or matrix

<render>[[3,4],[5,6]]</render>

and instead TeX induced people to want

<render>\frac{\sqrt \x^2 + \y^2}{z}</render>

<render>\begin{bmatrix} 1 & 2\\ 3 & 4\\ \end{bmatrix} \begin{bmatrix} 0 & 1\\ 0 & 0\\ \end{bmatrix}= \begin{bmatrix} 0 & 1\\ 0 & 3\\ \end{bmatrix}</render>

can't you see, that these are code designed to position symbols, it's not about math anymore. It's about a language that micro position symbols. It's called typesetting.

you never addressed this issue. Again, it's not about Mathematica.

http://xahlee.info/cmaci/notation/TeX_pestilence.html

Dan Lentz

+

1

2

1

2

1

+Xah Lee thanks for posting the examples they did serve to refresh my memory what exactly was the syntax were talking about.

ironically I was a big fan of this stuff in my college days... I used to do every paper (math or not) by handcrafted LaTeX2e. I'm not sure if LaTeX is even still actively used, but from bits and pieces I've seen in more modern dialect it looks quite different.

ironically I was a big fan of this stuff in my college days... I used to do every paper (math or not) by handcrafted LaTeX2e. I'm not sure if LaTeX is even still actively used, but from bits and pieces I've seen in more modern dialect it looks quite different.

You never realize what a pain in the balls TeX syntax is until you've tried to write a parser to turn TeX into something like HTML. Most of the time, TeX control sequences are prefix notation, but then you run into stuff like

$x\over y$

And then you realize you don't know shit about shit.

And I still say TeX is a brilliant masterpiece, and its source code (which I have read through in its entirety) is like a work of art. But it was designed for writing books, not for displaying on the web. It's kind of laughable that most math on the web uses TeX to clunkily create a .png image of an equation, which then cannot be searched or selected like text. It's a primitive abomination.

$x\over y$

And then you realize you don't know shit about shit.

And I still say TeX is a brilliant masterpiece, and its source code (which I have read through in its entirety) is like a work of art. But it was designed for writing books, not for displaying on the web. It's kind of laughable that most math on the web uses TeX to clunkily create a .png image of an equation, which then cannot be searched or selected like text. It's a primitive abomination.

Peter Bolch

+

1

2

1

2

1

Great, thank you.

Fabrice Popineau

+

2

3

2

3

2

+Xah Lee TeX had 2 versions : 1978 and 1982. It is frozen except for bug fixes since 1982, that is 32 years (an anniversary according to DEK, since it is 2^5!)

The \ business with \sin and so on is because \ is the character chosen to introduce macros.

Nothing is meant to stay this way. Actually \sin, \log and so on are macros expansing into something like \operatorname{sin} and so on. (Possibly you are aware of this?)

This is much different from Mathematica syntax.

There is much less syntax in TeX (it's a bit like about Lisp ;-) ) than you may think. Everyhting can be redefined. Even the \ can be redefined to be something else.

If you have enough courage and time to spent on this, you can have a glimpse at

http://www.tug.org/TUGboat/tb20-3/tb64fine.pdf

The \ business with \sin and so on is because \ is the character chosen to introduce macros.

Nothing is meant to stay this way. Actually \sin, \log and so on are macros expansing into something like \operatorname{sin} and so on. (Possibly you are aware of this?)

This is much different from Mathematica syntax.

There is much less syntax in TeX (it's a bit like about Lisp ;-) ) than you may think. Everyhting can be redefined. Even the \ can be redefined to be something else.

If you have enough courage and time to spent on this, you can have a glimpse at

http://www.tug.org/TUGboat/tb20-3/tb64fine.pdf

Xah Lee

+

1

2

1

2

1

+Fabrice Popineau thanks for comment. I have read extensively about TeX in 1990s. In the 1990s, i was a Mac boy, and that's Mac's desktop publishing era, i was heavily into typesetting and fonts, read tons about them, including Knuths' writing about them. Though, i have never dived into tech detail of TeX.

I used TeX/LaTeX a lot around 2004 to write math. That's the date my rant was written.

Your argument about TeX, doesn't seem to refute that it's a messy syntax soup language and does not preserve the structure in math expressions. Are you simply providing extra info, or is your info meant to refute my argument that TeX sucks?

Erik Naggum (the lisp expert/troll), have heavily ranted about TeX. Also i recall David something oldbie in comp.emacs. They are both TeX experts. Also, +Craig Lennox 's comment above. What do you think of that?

I used TeX/LaTeX a lot around 2004 to write math. That's the date my rant was written.

Your argument about TeX, doesn't seem to refute that it's a messy syntax soup language and does not preserve the structure in math expressions. Are you simply providing extra info, or is your info meant to refute my argument that TeX sucks?

Erik Naggum (the lisp expert/troll), have heavily ranted about TeX. Also i recall David something oldbie in comp.emacs. They are both TeX experts. Also, +Craig Lennox 's comment above. What do you think of that?

Dan Lentz

+

2

3

2

3

2

+Xah Lee I think I agree with your point that it would absolutely be much better to adopt a representation that preserved the semantics of its content, as much as possible. I think TeX was remarkable for its day, but let's all remember that day was a good 10-15 years before the ubiquity of web as a medium and I think it was never intended to address much other than printed media -- in which semantics are essentially limited to that which you can discern from printed form. So "pretty printing" in that context is not such an absurd idea as recognition by human eyes of printed form was of much higher priority.

I still think it might be a reasonable language for the work of typesetting but I would see it as something I'd expect to be automatically generated from some higher level representation... So maybe even more levels of representation might be appropriate for the range of purposes that have been discussed: Mathematica -> MathML -> TeX -> Printed Page. I think expecting one representation to be sufficient for all of these use cases might be unreasonable.

I still think it might be a reasonable language for the work of typesetting but I would see it as something I'd expect to be automatically generated from some higher level representation... So maybe even more levels of representation might be appropriate for the range of purposes that have been discussed: Mathematica -> MathML -> TeX -> Printed Page. I think expecting one representation to be sufficient for all of these use cases might be unreasonable.

All I can say is, if you think TeX has a minimal syntax, try writing a parser for it some day. It might sound simple, but there are special cases **everywhere**. Active characters. Delimited arguments vs. non-delimited ones. When do you ignore spaces. Special rules for turning newlines into \par. Are you in fucking restricted horizontal mode or motherfucking internal vertical mode? Keywords like "at", "by", "in", "to", "fil", "fill", "filll", etc. They all have subtle impact that will have you tearing your hair out for months.

Lisp syntax is a walk in the park by comparison. If it takes more than a day to write a Lisp parser, you should not be allowed around sharp objects.

Lisp syntax is a walk in the park by comparison. If it takes more than a day to write a Lisp parser, you should not be allowed around sharp objects.

Fabrice Popineau

+

1

2

1

2

1

+Xah Lee My point was rather to say that there is no syntax in TeX itself. What you call TeX syntax is either "Plain TeX" or "LaTeX" syntax.

For the good or the bad, TeX is very flexible (+Craig Lennox is definitely right in his last comment: there is no such thing as a TeX parser). Also for the good or the bad, it is this flexibility that allowed TeX to survive all this time. And the help of a good deal of very clever people that helped building all these CTAN packages and maintain them.

Also I wanted to add : one thing very annoying is the fact that you can't (or I don't think so) create for example a Mathematica syntax layer in TeX and isolate it, that is : you would still be able to mix low level TeX instructions. At least, that's what happens with LaTeX.

For the good or the bad, TeX is very flexible (+Craig Lennox is definitely right in his last comment: there is no such thing as a TeX parser). Also for the good or the bad, it is this flexibility that allowed TeX to survive all this time. And the help of a good deal of very clever people that helped building all these CTAN packages and maintain them.

Also I wanted to add : one thing very annoying is the fact that you can't (or I don't think so) create for example a Mathematica syntax layer in TeX and isolate it, that is : you would still be able to mix low level TeX instructions. At least, that's what happens with LaTeX.

Nick Alcock

+

1

2

1

2

1

+Xah Lee, "David something" is probably David Kastrup, AuCTeX and preview-latex maintainer and TeXnician par excellence.

Nick Alcock

+

3

4

3

4

3

Everything +Fabrice Popineau and +Craig Lennox says is right: TeX is designed for another age and is pretty crufty and is barely a language at all and really can't be parsed by anything except itself (it has other problems, like a demented implementation language, alien font formats that nobody else uses hedged around with a wall of thunks to make it work with the rest of the world, etc). Its only virtues are a degree of conciseness, a degree of closeness to the equations (a property also shared by Mathematica and very definitely **not** by MathML), its extreme stability and the fact that everyone already knows it. The stability, in particular, is assured by a work of fabulous madness of the like that we have never seen again, the trip and trap tests, which contain expected results for most aspects of TeX **computed by hand** over a period of several months.

But these virtues are**major** virtues, and should not be disregarded, particularly not with reasoning as specious as 'old therefore bad', which is faulty in most areas but doubly faulty when we're talking about something used for communication between humans and for generating long-lifespan documents from.

And having just tortured myself with a Perl 5.16 -> 5.18 upgrade, a 'minor' upgrade that broke half a dozen packages in painful ways and required rebuilding of everything under the sun, don't bring up Perl as an example of how backward compatibility should be done!!! :}

But these virtues are

And having just tortured myself with a Perl 5.16 -> 5.18 upgrade, a 'minor' upgrade that broke half a dozen packages in painful ways and required rebuilding of everything under the sun, don't bring up Perl as an example of how backward compatibility should be done!!! :}

+Fabrice Popineau All of the things I mentioned in my previous message are part of the initial TeX environment, not plain TeX or LaTeX.

Xah Lee

+

1

2

1

2

1

+Nick Alcock yep, David Kastrup. One of the emacs dev oldbie too. I recall we have swore at each other. Oh, one funny incident. One time, i bitched about lisp regex quoting problem, and he came in defending it, but in a irrelevant way (as perceived by me)... lol 'was the good old times. Don't know what he's up to, hope he's doing well.

Fabrice Popineau

+

1

2

1

2

1

+Craig Lennox I know, I was refering to Xah's message. I was merely stating that what Matjax renders (for example) is Plain or LaTeX syntax. TeX itself has no syntax.

Nick Alcock

+

1

2

1

2

1

+Xah Lee, David's still about, still doing Emacs stuff. Spending lots of time on other things though, hence the falloff in auctex activity and the ages since a release :P

+Fabrice Popineau, TeX has a sort of syntax, I'd say: it's just highly mutable. i.e. you can change which characters are active and what macros expand to, but you can't change the fact that it**has** a concept of active characters and macro-expansion.

+Fabrice Popineau, TeX has a sort of syntax, I'd say: it's just highly mutable. i.e. you can change which characters are active and what macros expand to, but you can't change the fact that it

+Nick Alcock Well, we could discuss what is a syntax and what kind of syntax TeX has. But the fact is that whatever syntax it is , the usual lex/yacc will be of little help to capture it :-) As I see it (and as it is described in TeX for the Impatient for example), it is rather an engine that gobbles characters, process and digest them to spit out something.

Agreed. It's even less like a normal neatly-parsed language than Perl is. :)

TeX is what we call a linear context-free rewriting system: close to a Type-2 grammar but not included in it. Sort of a Type-1.98 grammar. :)

Perl is what we call a mess.

Perl is what we call a mess.

Tassilo Horn

+

2

3

2

3

2

+Xah Lee, +Nick Alcock, David is one of the most active developers of GNU LilyPond now.

Hey, and there's still quite some activity in AUCTeX with lots of improvements since 11.87. It's just the release procedure that's so awful that nobody wants to do it often...

Hey, and there's still quite some activity in AUCTeX with lots of improvements since 11.87. It's just the release procedure that's so awful that nobody wants to do it often...

+Craig Lennox Formally speaking, I'm not so sure. I would rather put it in the "linear bounded automata" category. But close to CFGs? I don't feel it this way. It is a rewriting system but you can change the rewrite rules.

Add a comment...