Sunday, February 20, 2011

Programming as music and drama

Velato is a programming language in which the source code consists of MIDI music files, so that each program doubles as an electronic tune. This is how a "Hello World" program sounds, and this is an accordion rendition of a program that copies input to output.

Another strange programming language is Shakespeare, in which programs look like plays; variables have the names of characters and their values are determined by equations encoded as invective. The results are rather absurdist:
Scene II: Juliet and Ophelia's conversation.
[Enter Ophelia]
Juliet:
Thou art as good as the quotient between Romeo and the sum
of a small furry animal and a leech. Speak your mind!
Ophelia:
Thou art as disgusting as the quotient between Romeo
and twice the difference between a mistletoe and an 
oozing infected blister! Speak your mind!
[Exeunt] 

No comments:

Post a Comment