A stage play with rules hiding in the dialogue

The Shakespeare Programming Language, or SPL, makes a program look like a play. Its characters are variables: the names introduced at the start of the script become places where the program can store numbers. Acts and scenes divide the script into sections, while stage directions such as a character entering or exiting help control which section runs next.

The theatrical style is more than decoration. SPL gives particular phrases precise computational meanings, so the program’s performance is also its instruction set.

How an insult can produce a number

In ordinary code, a programmer might write a number directly or use a symbol such as `+`. SPL instead builds values from words. Adjectives and nouns carry positive or negative meanings under the language’s rules; combined in a phrase, they can represent a number. A line addressed to a character can then assign that value to the character’s variable.

Dialogue can also compare characters or make one insult another. Those exchanges are not interpreted by judging how rude they sound: the language parses their wording according to set rules and uses the result in an operation. Other kinds of lines handle tasks such as reading input, producing output, or changing the flow of the play.

The joke depends on exact structure

A script can be flamboyant, but it cannot be improvised. Character names, scene labels, and specially formed lines must follow SPL’s grammar—the formal pattern that tells the interpreter what each phrase means. A poetic-sounding sentence that breaks that pattern may fail as code, just as a misplaced instruction can derail a conventional program.

That constraint is the point of the design: Shakespearean language supplies the surface, while a small set of consistent rules turns theatrical exchanges into computation. The result is both a working programming language and a parody of how programming languages demand that every symbol, however dramatic, do a specific job.