October 13, 2014 AT 11:50 am

An AVR Emulator written in pure LaTeX – Turing completeness!


An AVR Emulator written in pure LaTeX – Christian Dietrich / avremu | GitLab.

LaTeX is known as a typesetting system. But the underlying TeX system is a powerful macro processor. In fact, TeX is a Turing-complete programming language. TeX can compute anything, that is computable. Computeability is a concept from theoretical computer science. After visiting a theoretical CS course, you will know that there are things that cannot be solved by a machine. Never. Look out for the halting problem. So, Turing-complete does not say “It’s a proper programming language”, but more “someone can write a proper interpreter for any programming language in it, theoretically”.

So back to TeX. To be honest, TeX is a horrible language to code in. After writing my master thesis in LaTex, after crafting every graphic within with TiKz[1] and pgfplots[2], and after writing my first LaTeX package[3], I can honestly say: TeX is the Quasimodo of all widely used programming languages. If you can avoid it, avoid it. But if you are forced to use it, you can abstract from TeX, since it is a “proper” programming language.

Let’s say we want to program our document in C on Top of Tex. Then there would be the need to interpret the C semantic. Basically we would have to write a compiler for C in TeX. Not a very promising future, if you start this. But, we can use a normal C compiler to compile the C code to some simple platform. Like AVR[4]. Since I have other things to do than writing an AVR Emulator in TeX, here it is!

Turing completeness!

Check out all the Circuit Playground Episodes! Our new kid’s show and subscribe!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground”Adafruit’s Apps!


Wearables — Design with IFTTT

Electronics — Keep track of those rails!

Biohacking — Why Our Eyes Cannot Look at a Solar Eclipse

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !

No Comments

No comments yet.

Sorry, the comment form is closed at this time.