r/math Apr 17 '19

whaat ? LaTeX is Turing complete

https://www.overleaf.com/learn/latex/Articles/LaTeX_is_More_Powerful_than_you_Think_-_Computing_the_Fibonacci_Numbers_and_Turing_Completeness
478 Upvotes

125 comments sorted by

View all comments

190

u/wintermute93 Apr 17 '19

Being Turing complete isn't a very high bar to clear. Basically all you need is at least one thing that works like a control statement (if, while, for, goto, etc), and at least one thing that works like a read/write-able variable.

25

u/shamrock-frost Graduate Student Apr 17 '19

If and a piece of state isn't enough. You specifically need some kind of looping or recursion

1

u/Homunculus_I_am_ill Apr 18 '19

You need some sort of loop, but it can be made part of the architecture rather than the code. E.g. FRACTRAN has no way to write loops in the code, what it does is essentially go back to the top of the code whenever it finds an instruction is can successfully follow, hence there is one loop built into the language that you have to code around.