Java is too boring? try programming in Shakespeare

in #programming8 years ago

remember that guy from school? This famous author of Romeo and Juliet?

Programming in Shakespeare

Probably, but did you know there exists a programming language called Shakespeare?
Oh yes, there is. And besides of those experimental languages like whitespace or brainfuck, Shakespeare is the craziest attempt of an esoteric programming language I ever heard of.

It was designed by two probably pretty crazy and masochistic guys Jon Åslund and Karl Hasselström. They designed a programming language that does not look and feel like a programming language. Instead they intented to design a language that has the same look and feel as one of the famous books written by Shakespeare.

How the heck can this work?

Well, to be fair, doing anything that makes sense in this language is more or less not achievable. One crazy guy managed to program the song 99 bottles of beer using Shakespeare - I included it as a bonus at the end of this blog. You can decide for yourself how effective programming in Shakespeare can probably be. BUT, you can be sure your fingers will hurt!


What a pretty couple. Let's make them say 'Hello World!' - shall we?

introducing variables

Yeah, variables have to be introduced. Exactly, variables can hold integers and have to have the name of a character Shakespeare introduced anytime. So the amount of variables is limited. This is how you introduce one:

Name, Description

Whereas description is a comment. The compiler will ignore it.

Acts and Scenes

Shakespearean code contains Acts and Scenes, just like a normal drama. One Act can have multiple scenes, in which the characters can interact. Yet make sure to give them Roman numbers, since these are GOTO labels for your code. It will look somewhat like this:

Act I: Where the action is.
Scene I: Where the beginnings are located.

Characters need to enter and leave the stage

Shakespeare has another restriction. Characters (variables) can only be addressed using 'you'. So there is one characters that speaks, and another that replies. So you always need to manually say which variables are allowed to interact. This can be done using three statements: Enter, Exit, and Exeunt.
Enter and Exit are quite self-explanatory, Exeunt allows to let both characters leave the stage. This makes programming much easier, doesn't it?

So your code will look something like this:
[Enter Juliet]
[Enter Romeo and Juliet]
[Exit Romeo]
[Exeunt Romeo and Juliet]
[Exeunt]

Assignment of values

Let me talk about one more thing, before we can read 99 bottles of beer as Shakespearean Drama. How do I assign a value to a variable?
Well well well, you need nouns and adjectives from a given list.
Positive nouns have a value of one, negative nouns a value of -1. Any adjective multiplies a noun by 2, and they can be compounded. That is a nice way to calculate, isn't is?

There are other signal-words acting as special operations like "sum", "quotient", and "cube" - but I'm not going to punish you with this further.
One nice thing is - you can also make loops, by using an if-statement and a goto operator like this:

Juliet:
Am I better than you?

Hamlet:
If so, let us proceed to scene III.

Ok ok, but why the heck would someone do something like this?

Regarding Shakespeare I would say... merely just because they can.
BUT, it is a nice proof-of-concept that programming languages can sound a lot more natural than they do normally, especially if you look at low-level languages like C, C++, Delphi and stuff.

There is only one difference between normal text and programming language. A text written in a programming language cannot be ambivalent. A computer cannot interpret a "maybe you could do that, if you want". This interpretation we humans do all the time is the main thing a programmer has to avoid, since he is giving orders to something completely stupid.
If by mistake, he says to a computer add 1 and 1 together for an infinite amount of time, the computer would do this until the end of humanity.

A language like Shakespeare shows that there are possibilities to design language that have a very natural look and feel, while still following the rules of programming. In this specific case it of course just produces extremely strange gibberish, but it is a nice proof-of-concept to show that our programming languages could look way different from how they look today.

bonus: 99 bottles of beer

and as promised, the song 99 bottles of beer by Shakesbeer - all credits belong to him:

Romeo, a man who curses men and likes women, while taking up some space.
Juliet, often the temporary affections of Romeo.
The Ghost,holds his liquor.
Hamlet, a man who is a bit jumpy.
Oberon, o.
Emilia, e.
Titus, t.
Ajax, n.
Angelo, a.
Shylock, s.
Lennox, l.
Bianca, b.
The Abbot of Westminster, w.
Desdemona, d.
Robin, r.
Capulet, ,.

         Act I: Where the action is.

      Scene I: Where the beginnings are located.

[Enter Hamlet and The Ghost]
Hamlet:
Thou art as mighty as the sum of a proud rich trustworthy hero
and a handsome Lord. Thou art as noble as the square of thyself.
Thou art as rich as the difference between thyself and a plum.
The Ghost:
Thou art as good as the difference between a Lord and a Lord.

    Scene II: Where bottles of beer are displayed.

[Exeunt]
[Enter Hamlet and The Ghost]
the Ghost:
Thou art as good as the sum of thyself and a Lord.
[Exeunt]
[Enter Romeo and the Ghost]
Romeo:
Open your heart.
the Ghost:
You are a fine brave gentle bold amazing Lord.
[Exit The Ghost]
[Enter Bianca]
Bianca:
Speak your mind.
Romeo:
Thou art as lovely as the sum of a charming handsome healthy
lovely pretty noble angel and the sum of a sweet beautiful
lovely fine sunny summer's day and a golden hair. Speak your mind.
[Exit Bianca]
[Enter Oberon]
Romeo:
Thou art as foul as the difference between the sum of a horrible
disgusting rotten oozing blister and a toad and a cursed
miserable dirty disgusting hairy
half-witted lying coward.
Speak your mind.
[Exit Oberon]
[Enter Titus]
Romeo:
Thou art as foul as the difference between the sum of a horrible
disgusting rotten blister and a dirty smelly toad and a cursed
miserable dirty disgusting hairy half-witted lying coward.
Speak your mind. Speak your mind.
[Exit Titus]
[Enter Lennox]
Romeo:
Thou art as foul as the difference between the sum of a horrible
disgusting rotten oozing blister and a dirty smelly toad and a cursed
miserable dirty disgusting hairy half-witted lying coward.
Speak your mind.
[Exit Lennox]
[Enter Emilia]
Romeo:
Thou art as lovely as the sum of a charming handsome healthy
lovely pretty noble angel and the sum of a sweet beautiful
lovely fine sunny summer's day and the sum of a golden hair
and the sum of a red rose and a flower. Speak your mind.
[Exit Emilia]
[Enter Shylock]
Romeo:
Thou art as foul as the difference between the sum of a horrible
disgusting rotten blister and a dirty smelly toad and the sum of
a cursed miserable dirty disgusting hairy half-witted lying
coward and a cow.
[Exit Romeo]
[Enter the Ghost]
the Ghost:
Am I as good as a plum? If not, Speak your mind.
[Exit the Ghost]
[Enter Romeo]
Shylock:
Speak your mind.
[Exit Shylock]
[Enter Oberon]
Romeo:
Speak your mind.
[Exit Oberon]
[Enter Juliet]
Romeo:
Thou art as lovely as the sum of a charming handsome healthy
lovely pretty noble angel and the sum of a sweet beautiful
lovely fine sunny summer's day and the sum of a golden hair
and the sum of a red rose and a yellow flower. Speak your mind.
Juliet:
Speak your mind.
[Exit Juliet]
[Enter Bianca]
Romeo:
Speak your mind.
[Exit Bianca]
[Enter Emilia]
Romeo:
Speak your mind.
Speak your mind.
[Exit Emilia]
[Enter Robin]
Romeo:
Thou art as foul as the difference between the sum of a horrible
disgusting rotten blister and a dirty smelly toad and the sum of
a cursed miserable dirty disgusting hairy half-witted lying
coward and a big cow.
Speak your mind.
[Exit Robin]
[Enter Hamlet]
Hamlet:
Am I as good as a Lord?
If so, let us proceed to Scene III.
Am I as good as a fine Lord?
If so, let us proceed to Scene V.
Let us proceed to Scene III.

     Scene III: Where a wall enters the picture.

[Exeunt]
[Enter Romeo and Oberon]
Oberon:
Speak your mind.
Romeo:
Speak your mind.
[Exit Oberon]
[Enter Ajax]
Romeo:
Thou art as foul as the difference between the sum of a horrible
disgusting rotten oozing blister and a smelly toad and a cursed
miserable dirty disgusting hairy half-witted lying
coward.
Speak your mind.
Ajax:
Speak your mind.
[Exit Ajax]
[Enter Titus]
Romeo:
Speak your mind.
[Exit Titus]
[Enter Juliet]
Romeo:
Thou art as lovely as the sum of a charming handsome healthy
lovely pretty noble angel and the sum of a sweet beautiful
lovely fine sunny summer's day and the sum of a beautiful golden
hair and a lovely red rose. Speak your mind.
[Exit Juliet]
[Enter Emilia]
Romeo:
Speak your mind.
Emilia:
Speak your mind.
[Exit Emilia]
[Enter The Abbot of Westminster]
Romeo:
Thou art as foul as the difference between the sum of a normal
furry little goat and the sum of a cow and a black hog and a
horrid infected rotten oozing smelly stinking vile
blister. Speak your mind.
[Exit The Abbot of Westminster]
[Enter Angelo]
Romeo:
Thou art as foul as the difference between the sum of a disgusting
fat miserable dirty smelly toad and a cow and a
horrid infected rotten oozing smelly stinking vile
blister. Speak your mind.
[Exit Angelo]
[Enter Lennox]
Romeo:
Speak your mind. Speak your mind.
[Exit Lennox]
[Enter Capulet]
Romeo:
Thou art as foul as the difference between a huge big cow and
the sum of a cursed vile evil plague and a horrible huge hairy
dirty smelly hog.
[Exit Romeo]
[Enter the Ghost]
the Ghost:
Am I worse than an animal?
If so, let us proceed to Scene VI.
[Exeunt]
[Enter Hamlet and Capulet]
Hamlet:
Am I as good as a Lord?
If so, speak your mind.
[Exit Capulet]
[Enter Romeo]
Hamlet:
Am I as good as a son?
If so, speak your mind.
Am I as good as a brother?
If so, let us return to Scene II.
[Exeunt]
[Enter Juliet and Capulet]
Capulet:
Remember me. Recall my last remark.
[Exit Capulet]
[Enter Romeo]
Romeo:
Thou art as fine as the sum of thyself and a red rose.
Speak your mind.
Let us return to Scene IV.

         Scene IV: Where a line ends.

[Exeunt]
[Enter Romeo and Juliet]
Romeo:
Thou art as lovely as the sum of a flower and the sum of a
lovely red rose and a beautiful gentle sunny summer's
day. Speak your mind.

Thou art as cute as the difference between yourself and the sum of a
furry cat and an animal. Speak your mind.

[Exeunt]
[Enter Hamlet and The Ghost]
The Ghost:
Thou art as good as the difference between thyself and thyself.
Let us return to Scene II.

      Scene V: Where bottles are passed around.

[Exeunt]
[Enter Juliet and Capulet]
Capulet:
Remember me. Recall that I always tell you to do so.
[Exit Capulet]
[Enter Romeo]
Romeo:
Thou art as lovely as the sum of thyself and a gentle summer's
day. Speak your mind.

Thou art as lovely as the sum of a rose and the sum of a
lovely gentle summer's day and a beautiful fine yellow
flower. Speak your mind. 

Thou art as cute as the difference between yourself and the sum of a
small animal and a daughter. Speak your mind.

[Exit Juliet]
[Enter Titus]
Romeo:
Thou art as foul as the sum of thyself and a foul smelly
oozing evil red blister. Speak your mind.

Thou art as foul as the difference between thyself and a foul smelly
oozing evil red blister.

[Exit Titus]
[Enter Angelo]
Romeo:
Speak your mind.
[Exit Angelo]
[Enter Juliet]
Romeo:
Thou art as lovely as the sum of a charming handsome healthy
lovely pretty noble angel and the sum of a sweet beautiful
lovely fine sunny summer's day and the sum of a fair warm golden
hair and the sum of a little animal and a cat. Speak your mind.
[Exit Juliet]
[Enter Emilia]
Romeo:
Speak your mind.
Emilia:
Speak your mind.
[Exit Emilia]
[Enter Oberon]
Romeo:
Speak your mind.
[Exit Oberon]
[Enter Ajax]
Romeo:
Speak your mind.
[Exit Ajax]
[Enter Emilia]
Romeo:
Speak your mind.
Emilia:
Speak your mind.
[Exit Emilia]
[Enter Desdemona]
Romeo:
Thou art as lovely as the sum of a charming handsome healthy
lovely pretty noble angel and the sum of a sweet beautiful
lovely fine sunny summer's day and a fair golden hair. Speak
your mind.
[Exit Desdemona]
[Enter Oberon]
Romeo:
Speak your mind.
[Exit Oberon]
[Enter The Abbot of Westminster]
Romeo:
Speak your mind.
[Exit The Abbot of Westminster]
[Enter Ajax]
Romeo:
Speak your mind.
[Exit Ajax]
[Enter Capulet]
Romeo:
Speak your mind.
Capulet:
Speak your mind.
[Exit Capulet]
[Enter Juliet]
Romeo:
Thou art as lovely as the sum of a charming handsome healthy
lovely pretty noble angel and the sum of a sweet beautiful
lovely fine sunny summer's day and the sum of a fair fine
golden hair and a beautiful little red rose. Speak your mind.
[Exit Juliet]
[Enter Angelo]
Romeo:
Speak your mind.
[Exit Angelo]
[Enter Shylock]
Romeo:
Speak your mind.
Speak your mind.
Shylock:
Speak your mind.
[Exit Shylock]
[Enter Juliet]
Romeo:
Thou art as lovely as the sum of a charming handsome healthy
lovely pretty noble angel and the sum of a sweet beautiful
lovely fine sunny summer's day and the sum of a fair fine
golden hair and a rose. Speak your mind.
[Exit Juliet]
[Enter Titus]
Romeo:
Speak your mind.
Titus:
Speak your mind.
[Exit Titus]
[Enter Angelo]
Romeo:
Speak your mind.
[Exit Angelo]
[Enter Robin]
Romeo:
Speak your mind.
[Exit Robin]
[Enter Oberon]
Romeo:
Speak your mind.
[Exit Oberon]
[Enter Juliet]
Romeo:
Thou art as lovely as the sum of a charming handsome healthy
lovely pretty noble angel and the sum of a sweet beautiful
lovely fine sunny summer's day and the sum of a fair fine
golden hair and the sum of a beautiful little red rose and the
sum of a little furry cat and an animal. Speak your mind.
[Exit Juliet]
[Enter Ajax]
Romeo:
Speak your mind.
[Exit Ajax]
[Enter Desdemona]
Romeo:
Speak your mind.
[Exit Desdemona]
[Enter Capulet]
Romeo:
Speak your mind.
Capulet:
Speak your mind.
[Exeunt]
[Enter Hamlet and The Ghost]
Hamlet:
Thou art as rich as the difference between thyself and a plum.
The Ghost:
Let us return to Scene II.

          Scene VI: The End.

[Exeunt]
[Enter Capulet and Juliet]
Capulet:
Remember me. Recall the last time we met.
[Exit Capulet]
[Enter Romeo]
Romeo:
Thou art as pretty as the sum of thyself and a
furry animal. Speak your mind.

Thou art as lovely as the sum of a flower and the sum of a
lovely red rose and a beautiful gentle sunny summer's
day. Speak your mind.

Thou art as cute as the difference between yourself and the sum of a
furry cat and an animal. Speak your mind.

[Exeunt]

Sort:  

Congratulations @felixa! You have received a personal award!

2 Years on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard!


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @felixa! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 3 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

The Steem community has lost an epic member! Farewell @woflhart!
SteemitBoard - Witness Update
Do not miss the coming Rocky Mountain Steem Meetup and get a new community badge!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!