DEV Community

Cover image for 🎭 Shakespeare — The Language Written as a Play*
Pʀᴀɴᴀᴠ
Pʀᴀɴᴀᴠ

Posted on

🎭 Shakespeare — The Language Written as a Play*

What is Shakespeare?

Shakespeare Programming Language (SPL) is an esoteric language created by Jon Åslund and Karl Hasselström in 2001. The goal was to make programs read like Shakespearean plays rather than normal code. Instead of variable names, the language uses characters like Hamlet, Juliet, Ophelia, and Macbeth. Instead of numbers or operators, it uses poetic adjectives and nouns to define values.

Programs in SPL look like scripts with acts, scenes, dialogues, and dramatic expressions. Under the surface, however, SPL is stack-based and fully Turing-complete, meaning it's capable of performing real computation despite the theatrical presentation.


Specs

Language Type: Esoteric / Literary

Released: 2001

Creators: Karl Hasselström & Jon Åslund

Syntax Style: Shakespeare theater script format

Execution Model: Stack-based with character interactions


CODE EXAMPLE (Hello World)

The First Play.

Romeo, a hero.
Juliet, a pretty lady.

Act I: The only scene.
Romeo:
You are as lovely as the sum of a charming star and a warm summer day!
Speak your mind!
Juliet:
You are as peaceful as the difference between night and morning.
Speak your mind!
Enter fullscreen mode Exit fullscreen mode

(This prints “Hello World” depending on interpreter version.)


How It Works

  • Characters are variables.
  • Adjectives modify values positively or negatively.
  • Nouns map to numbers (e.g., “cat” = 1, “ocean” = 1000).
  • Dialogue lines represent instructions like pushing, printing, or performing arithmetic.
  • Scenes and acts control flow like functions and labels.
  • Interactions mimic theater conversation but function like computational logic.

Behind the poetic language, SPL behaves like a stack manipulation and branching language.


Strengths

  • Highly creative and literary.
  • Programs read like theatrical scripts rather than technical syntax.
  • Fun for demonstrations, experiments, and programming humor.
  • Famous among esolang enthusiasts.

Weaknesses

  • Hard to learn and harder to debug.
  • Syntax rules are cryptic despite being written in English.
  • Longer and more verbose than most languages.
  • Limited interpreters and tooling.

Where to Run

SPL can be executed using interpreters found on GitHub or community-run tools on TIO.run. Some implementations include syntax highlighters or examples.


Should You Learn It?

For production software: No

For humor and creativity: Yes

For understanding stack-based logic differently: Yes

For quick coding: Never


Summary

Shakespeare Programming Language transforms code into a theatrical script. Instead of structured syntax, SPL uses dramatic language, poetic metaphors, and character dialogues to perform computation. While completely impractical for real development, it stands as one of the most unique, memorable, and entertaining programming languages ever created — a blend of literature, logic, and absurd creativity.

Top comments (0)