Log In · Register

 
 
Reply to this topicStart new topic
Shakespeare programming language
mipadi
post Sep 22 2009, 12:50 PM
Post #1


Senior Member
******

Group: Administrator
Posts: 2,648
Joined: Apr 2008
Member No: 639,265



I recently discovered a particularly interesting programming language called "Shakespeare" which structures computer programs like Shakespearean plays. Here's a standard "Hello, World" program written in Shakespeare:

CODE
The Infamous Hello World Program.

Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.


                    Act I: Hamlet's insults and flattery.

                    Scene I: The insulting of Romeo.

[Enter Hamlet and Romeo]

Hamlet:
You lying stupid fatherless big smelly half-witted coward!
You are as stupid as the difference between a handsome rich brave
hero and thyself! Speak your mind!

You are as brave as the sum of your fat little stuffed misused dusty
old rotten codpiece and a beautiful fair warm peaceful sunny summer's
day. You are as healthy as the difference between the sum of the
sweetest reddest rose and my father and yourself! Speak your mind!

You are as cowardly as the sum of yourself and the difference
between a big mighty proud kingdom and a horse. Speak your mind.

Speak your mind!

[Exit Romeo]

                    Scene II: The praising of Juliet.

[Enter Juliet]

Hamlet:
Thou art as sweet as the sum of the sum of Romeo and his horse and his
black cat! Speak thy mind!

[Exit Juliet]

                    Scene III: The praising of Ophelia.

[Enter Ophelia]

Hamlet:
Thou art as lovely as the product of a large rural town and my amazing
bottomless embroidered purse. Speak thy mind!

Thou art as loving as the product of the bluest clearest sweetest sky
and the sum of a squirrel and a white horse. Thou art as beautiful as
the difference between Juliet and thyself. Speak thy mind!

[Exeunt Ophelia and Hamlet]


                    Act II: Behind Hamlet's back.

                    Scene I: Romeo and Juliet's conversation.

[Enter Romeo and Juliet]

Romeo:
Speak your mind. You are as worried as the sum of yourself and the
difference between my small smooth hamster and my nose. Speak your
mind!

Juliet:
Speak YOUR mind! You are as bad as Hamlet! You are as small as 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. Speak your mind!

[Exit Romeo]

                    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]


Believe it or not, the language works -- it has a functional Shakespeare-to-C compiler distributed with the project. Pretty nifty.
 
synapse
post Oct 8 2009, 09:57 PM
Post #2


Live long and prosper.
********

Group: Staff Alumni
Posts: 10,142
Joined: Apr 2007
Member No: 514,926



So, wait... You have to write out all that, which is plain English anyhow.. to write hello world? Or is there something that I'm overlooking?
 
heyo-captain-jac...
post Oct 8 2009, 10:08 PM
Post #3


/人◕‿‿◕人\
*******

Group: Official Member
Posts: 8,283
Joined: Dec 2007
Member No: 602,927



I don't see how that could work as a Hello World program.


Kinda related, as it's about a programming language.

I'm learning Assembly. Shit's so time consuming.
 
mipadi
post Oct 9 2009, 09:07 AM
Post #4


Senior Member
******

Group: Administrator
Posts: 2,648
Joined: Apr 2008
Member No: 639,265



QUOTE(tcunningham @ Oct 8 2009, 10:57 PM) *
So, wait... You have to write out all that, which is plain English anyhow.. to write hello world? Or is there something that I'm overlooking?


Yep, that is a hello world program written in Shakespeare. You're not overlooking anything.

Re: how it works: the linked page explains how the language works. Basically, different characters are variables, and different types of nouns represent different numerical values. The values are pushed onto a stack, and the command "Speak your mind!" forces those values to be printed as characters to the screen.
 
kryogenix
post Oct 16 2009, 03:44 AM
Post #5


Sarcastic Mr. Know-It-All
******

Group: Staff Alumni
Posts: 2,089
Joined: Dec 2003
Member No: 29



Haha, that's pretty clever. So are the characters meant to be classes?
 
mipadi
post Oct 16 2009, 07:04 AM
Post #6


Senior Member
******

Group: Administrator
Posts: 2,648
Joined: Apr 2008
Member No: 639,265



QUOTE(kryogenix @ Oct 16 2009, 04:44 AM) *
Haha, that's pretty clever. So are the characters meant to be classes?

Variables.
 

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: