An interpreter for everyone's favorite obfuscated functional programming language, Unlambda. The interpreter is actually mildly useless in several respects: (a) building the tree on large Unlambda programs takes a surprisingly long time; (b) since Python doesn't do tail recursion, you have the option of having your program hit the recursion limit if it's too low, or segfaulting if it's too high (there can be a "just right", for instance for this quine, but that's really just luck); (c) it's an Unlambda interpreter, so how useful could it be?
But it is admirably short, and was written in an admirably short amount of time.
Or rather, it's not really not tail-recursing that's the problem, it's that the stack will grow and grow anyway. An only slightly less elegant alternative doesn't have that problem.
Comments