Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I've heard that LaTeX is Turing complete. Are there any programs written in LaTeX?

It's possible to do interesting things with what would ordinarily be thought of as typesetting languages. For example, you can construct the Mandelbrot set using postscript.

It is suggested in this MathOverflow question that LaTeX may be Turing-complete. This implies the ability to write arbitrary programs (although it may not be easy!). Does anyone know of any concrete example of such a program in LaTeX, which does something highly unusual with the language?

like image 697
ire_and_curses Avatar asked Jun 03 '10 17:06

ire_and_curses


People also ask

Is JavaScript Turing complete?

Now if you think about any modern programming language, they also take programs(written by us) as input and run them. Further, any program that can be theoretically written to run for a Turing machine can also be written in JavaScript. Thus, JavaScript is Turing complete. That's it!

What is Turing complete programming language?

Practically, what you need to know is that a Turing-complete language (also called a universal language) is one where you can compute anything that any other computational method can compute. In other words, a language that's non-universal—or Turing incomplete—has some limits on the set of things that it can compute.

Is PHP Turing complete?

PHP is a Turing complete computer language. However any distribution of PHP is going to come with a huge number of standard libraries, so much so that the standard PHP libraries could be classified as a framework.

Is pure HTML Turing complete?

By itself (without CSS or JS), HTML (5 or otherwise) cannot possibly be Turing-complete because it is not a machine. Asking whether it is or not is essentially equivalent to asking whether an apple or an orange is Turing complete, or to take a more relevant example, a book. HTML is not something that "runs".


1 Answers

In issue 13 of The Monad Reader, Stephen Hicks writes about implementing the solution to an ICFP contest (involving Mars rover navigation) in TeX, with copious use of macros. Amusingly, the solution's output when typeset is a postscript map of the rover's path.

like image 194
Derrick Turk Avatar answered Sep 19 '22 16:09

Derrick Turk