셰익스피어 프로그래밍 언어
Shakespeare Programming Language
1. 개요
난해한 프로그래밍 언어. 이런 종류의 프로그래밍 언어 중에서는 정말 정점을 달리는 '''독보적인 변태성'''을 자랑한다. 약자는 SPL.
존 아이슬런드와 카를 하셀슈트룀이라는 사람이 만들었으며 셰프 프로그래밍 언어를 좀 더 난해하게 꼬아놓은 타입이다. 이름이 셰익스피어 프로그래밍 언어인 이유는 '''소스 코드가 셰익스피어의 연극 대본같기 때문이다.''' 이곳에서 직접 프로그래밍 할 수 있다.
2. 구성
- 타이틀
-  등장인물- 이름, 명령으로 구성되며 먼저 이름을 쓴 다음 뒤에 명령을 입력한다. 명령어가 전부 대화문 형식으로 되어 있다.
 
-  액트, 씬- 다른 프로그래밍 언어로 치면 GOTO 같은 명령어로, 갈 수 있는 지점을 지정하는 것이다.
 
-  입장, 퇴장, 단체퇴장- 입장은 루틴 정의. 퇴장은 루틴을 종료할때 쓰인다. 단체퇴장은 프로그램 종료.
 
3. 문법
- 프로그램의 첫 줄에는 프로그램 이름(극의 이름)을 쓴다. 한 번의 마침표 전까지는 몇 줄을 써도 상관은 없다. 프로그램에서는 무시한다.
The Infamous Hello World Program.- 그 다음에는 극에 나오는 등장인물을 적는다. 이들은 변수로 각자 한가지 값을 가진다. 등장인물은 실제 셰익스피어 극 중에 나오는 인물이여야 한다. 이름 뒤에 반점을 적고 설명을 적는다. 프로그램에서는 무시한다.
Romeo, a young man with a remarkable patience.-  코드가 실행되는 부분은 극중에서의 장면들이다. 
 와Act
 [1]이 있고 로마 숫자를 붙인다. 이를 이용하여Scene
 를 구현할 수 있다. 숫자 뒤에는 콜론이 붙고 설명을 적는다. 프로그램에서는 무시한다.goto
Act I: Hamlet's insults and flattery.Scene I: The insulting of Romeo.-  등장인물은 무대 위로 나와야 어떤 행동을 할 수 있으므로 입장
 , 퇴장Enter
 을 해야 한다. 그리고 극이 끝났을 때에는 모든 사람을 내보내야 한다Exit
 .[2] 무대 위에 있는 것으로 각 등장인물은 너Exeunt
 라는 표현을 썼을 때 누구인지 알 수 있다. 이 셋은 대괄호 안에 적는다.you
[Enter Hamlet and Romeo][Exit Romeo][Exeunt]- 대사는 ‘인물: 대사’ 로 이루어져 있다. 대사에서 코드가 작동되는 것이다.
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!- 숫자(상수)가 계산되는 방법은 명사를 긍정, 중립, 부정으로 나눈뒤 긍정과 중립은 1, 부정은 -1이 된다. 명사 앞에는 형용사가 올 수 있는데 1개 붙을 때마다 2씩 곱해진다.
a piga dirty fat piga good nice man- 연산자는 말로 표현한다. 다음이 있다.
the sum of ... and ...the difference between ... and ...the product of ... and ...the quotient between ... and ...the remainder of the quotient between ... and ...the factorial of ...the square of ...the cube of ...the square root of ...twice-  등장인물(변수)에 값을 지정할 때에는 단순이 …는 …이다. 라고 적어도 되고 
 를 적어도 된다. 변수의 값을 말하고 싶을 때는as ... as
 등 맞는 단어를 골라 쓰면 된다.[3]you, yourself, me, myself ...
You are a dirty pigYou are as bad as a dirty pig- 출력에는 아래 2가지 구문이 있다.
Open your heartSpeak your mind- 입력에도 아래 2가지 구문이 있다.
Listen to your heartOpen your mind-  어느 한 구문에서 다른 구문으로 이동하는 
 함수는 다음과 같이 구현이 가능하다.goto
Let us return to scene IILet usWe shallWe mustreturn toproceed toActAct-  조건문은 한 등장인물이 어떤 조건을 물어보고 
 또는If so,
 을 대답하는 것으로 이루어진다.If not,
Juliet:Am I better than you?Hamlet:
If so, let us proceed to scene III.-  두 값을 비교하는 것은 다음과 같다.[4]-  같은지 비교할 때: be ... as 형용사 as ...
-  앞의 값이 더 큰지 비교할 때: be ... better(긍정적인 비교급) than ...
-  뒤의 값이 더 큰지 비교할 때: be ... worse(부정적인 비교급) than ...
 
-  같은지 비교할 때: 
'not'을 앞에 붙어 반대의 경우도 가능하다.
- 각각의 등장인물에는 스택이 있으며 아래의 방법으로 사용이 가능하다.
Remember me.Recall ...4. Hello World!
4.1. 예문
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]4.2. 해석(?)
프로그래밍 언어로 쓰인 글이기 때문에 문자 그대로 읽으면 전혀 말이 되지 않는다.
4.3. 프로그래밍 언어로서의 해석
각각의 명사는 의미가 긍정적이거나 중립이면 1, 부정적이면 -1의 값을 가지고, 명사 앞에 형용사가 올 때마다 명사의 값은 2배가 된다. Yourself나 thyself는 상대방에 해당하는 값이다. 따라서 첫 문장인 "You lying stupid fatherless big smelly half-witted coward!"는 명사가 부정적이고 형용사가 6개이므로 Romeo = -64가 된다. 그 다음 문장인 "You are as stupid as the difference between a handsome rich brave hero and thyself!"는 Romeo가 handsome rich brave hero에서 Romeo를 뺀 값인 72가 된다. 다음 문장인 "Speak your mind!"에서는 Romeo의 값에 해당하는 아스키 코드 문자인 "H"를 출력한다.