Description #
Shakespeare Programming Language (SPL) is an esoteric language where code is written in the style of a Shakespearean play. Variables are characters, stacks are soliloquies, and control flow is structured like acts and scenes. It’s theatrical, verbose, and intentionally confusing—but Turing complete.
History #
SPL was created in 2001 by Karl Hasselström and Jon Åslund. Their goal was to create a language that could “make programs look like Shakespeare plays.” While it’s mostly a novelty, it demonstrates that programming syntax can be wildly expressive and still functional.
Hello World Code #
The Infamous Hello World.
Romeo, a young man with remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Act I: The Only Act.
Scene I: The Beginning.
[Enter Romeo and Juliet]
Romeo:
You are as lovely as the sum of yourself and a noble heart.
Speak your mind!
Juliet:
You are as lovely as the sum of yourself and a noble heart.
Speak your mind!
[Exeunt]
How to Run #
Option 1: Online
Option 2: Local
Use SPL interpreter (e.g., shakespearelang):
Save code as hello.spl
and run:
./spl hello.spl
Key Concepts #
- Code structured as a Shakespearean play
- Characters as variables
- Sentiment analysis as logic (positive = 1, negative = -1)
- Arithmetic via adjectives and comparisons
- Act/Scene = flow control
- “Speak your mind” = output
- Supports basic input/output
- Stack-based memory and scope
- No comments; everything is “dialogue”
- Syntax meant to be literary, not logical
Try It Online #
Fun Facts #
- Every variable must be named after a Shakespeare character.
- Negative comparisons like “you are as vile as the sum of a toad and a wart” affect logic.
- The compiler must parse actual human sentiment to interpret math.