Code Golf: Shortest Turing-complete interpreter.
Posted
by ilya n.
on Stack Overflow
See other posts from Stack Overflow
or by ilya n.
Published on 2009-06-28T00:32:28Z
Indexed on
2010/06/13
19:42 UTC
Read the original article
Hit count: 371
I've just tried to create the smallest possible language interpreter. Would you like to join and try?
Rules of the game:
- You should specify a programming language you're interpreting. If it's a language you invented, it should come with a list of commands in the comments.
- Your code should start with example program and data assigned to your code and data variables.
- Your code should end with output of your result. It's preferable that there are debug statements at every intermediate step.
- Your code should be runnable as written.
- You can assume that data are 0 and 1s (int, string or boolean, your choice) and output is a single bit.
- The language should be Turing-complete in the sense that for any algorithm written on a standard model, such as Turing machine, Markov chains, or similar of your choice, it's reasonably obvious (or explained) how to write a program that after being executred by your interpreter performs the algorithm.
- The length of the code is defined as the length of the code after removal of input part, output part, debug statements and non-necessary whitespaces. Please add the resulting code and its length to the post.
- You can't use functions that make compiler execute code for you, such as
eval()
,exec()
or similar.
This is a Community Wiki, meaning neither the question nor answers get the reputation points from votes. But vote anyway!
© Stack Overflow or respective owner