SPL: Shakespeare Programming Language

(Thanks to Sean Kauffman for letting me know this was out there)

Not actually a compiler (whatver that is), SPL is simply an SPL to C converter. The conceit is that you can write your code in shakespearian language (plus some minor boolean opperators) - complete with a play title, declaration of the dramatis personae (variables, must be actual Shakespearian characters), act and scene breaks, entrances, exits, and spoken lines.

The laws of the language are fairly simple in terms of their computational power, and fairly robust in terms of poetic licnese. that is, if you consider layer apon layer of adjectives to be poetic.

you can also read some basic SPL scripts here.

Any noun is a constant with the value 1 or -1, depending on whether it’s nice or not. For example, “flower'’ has the value 1 because flowers are nice, but “pig'’ has the value -1 because pigs are dirty (which doesn’t prevent most people from eating them). Neutral nouns, such as “tree'’, count as 1 as well.

By prefixing a noun with an adjective, you multiply it by two. Another adjective, and it is multiplied by two again, and so on. That way, you can easily construct any power of two or its negation. From there, it’s easy to construct arbitrary integers using basic arithmetic, such as “the sum of X and Y'’, where X and Y are themselves arbitrary integers.

For example, “the difference between the square of the difference between my little pony and your big hairy hound and the cube of your sorry little codpiece'’. Substituting the simple constants with numbers, we get “the difference between the square of the difference between 2 and 4 and the cube of -4′’. Now, since the difference between 2 and 4 is 2 - 4 = -2, and the cube of -4 is (-4)^3 = -64, this is equal to “the difference between the square of -2 and -64′’. The square of -2 is (-2)^2 = 4, and the difference of 4 and -64 is 60. Thus, “the difference between the square of the difference between my little pony and your big hairy hound and the cube of your sorry little codpiece'’ means 60.

As you see, this way of writing constants gives you much more poetic freedom than in other programming languages.

Comments are closed.