[Tex/LaTex] Why does Java have Eclipse and NetBeans, but TeX cannot

compilingeclipseeditorsjavawysiwyg

I faced these questions when I was searching for an intelligent Windows TeX editor:

Specially, in the second question, in the selected answer, it has been claimed that writing such an editor means a background-running editor! If it is surprisingly the case, what is the intrinsic difference between Java and TeX which makes this difference?


Note: In programs like Eclipse, you see the compile errors as you write them, in real time.

Best Answer

The main difference is that Java is a language with a fixed grammar and a compiler separate from execution.

TeX has neither of those things, there is no fixed grammar, even the lexical analysis and tokenisation depends on the run time behaviour.

So a Java editor can use a java compiler, or (more likely) its own inbuilt implementation of the Java syntax grammar and report errors but that is not possible with TeX.

An editor can (and usually does) report simple things like mis-matched brackets but even that results in false error reports

$(1,2]$ 

is perfectly legal as is

\catcode`?=2
\mbox{aaa?

For bracket matching the simple check is probably right often enough that it is worth doing but if you try to do more then you will get false reports of syntax errors more often than not so it is not helpful.

What you can do, and some systems do, is run tex in the background and update the preview whenever there is a result to be previewed.