[texworks] Count Characters Script
chuck at sharpsteen.net
Tue Mar 13 21:52:04 CET 2012
On Tue, Mar 13, 2012 at 12:29 PM, Philip TAYLOR <P.Taylor at rhul.ac.uk> wrote:
> Stefan Löffler wrote:
>  <off-topic>Is TeX Turing-complete?</off-topic>
> I have always  believed so.
> Philip Taylor
>  Where "always" is defined as "since 1986".
TeX is worse than Turing-complete---most boring old Turing-complete
programming languages can be completely parsed and deconstructed by a
"dumb" syntax highlighter implemented in a few lines of regular
expressions. TeX is __context sensitive__ and therefore also requires a
This is why it is so difficult to deconstruct an arbitrary bit of TeX
compared to most programming languages, like Python. Python can be parsed
with a simple rule-based program while TeX has to be processed by a program
that could also perform Lambda calculus, serve as a BASIC
interpreter, or function as a control program for NASA's Mars rovers.
The parser for a language like Python cannot stray outside of the rules
defined by the language grammer. The parser for a TeX document can typeset
TeX, or be re-purposed do any other computable task if given the right
See the following TeX StackExchange question for proof and demonstrations:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the texworks