Repository navigation
Releases
v0.1.0
The-Dotnet-Bard v0.1.0
Released 2026-07-30.
The first release of The-Dotnet-Bard, an interpreter for the Shakespeare Programming Language (SPL) written in C# on .NET 10. SPL programs read like Shakespeare plays — characters are variables, dialogue is computation, and the drama is Turing-complete. This release ships a complete interpreter, a command-line front end, a reusable NuGet library, ten sample plays, and a 32-entry language decision catalog.
Highlights
- Complete SPL interpreter. A hand-written lexer and recursive-descent parser drive the full language: character declarations, acts and scenes as jump labels, enter/exit/exeunt stage directions, assignments, the full arithmetic set (sum, difference, product, quotient, remainder, square, cube, square root, twice, factorial), questions and
if so/if notconditionals, gotos, per-character stacks (remember/recall), and numeric and character I/O. The core library has zero third-party runtime dependencies. - Faithful to the original spl2c where the spec is silent — including two features the popular Python implementation lacks: jumps to an act (spec §4.2), not just scenes; and
not-inverted comparisons ("Am I not better than you?") plusless + adjectivecomparatives. - Parenthetical aside comments
( ... ), a project extension: the spec has no comment syntax, so this interpreter treats parenthesized text as spoken to the audience and unheard by the interpreter, in code regions only. - 32 documented language decisions (D1–D32) in
docs/spec-decisions.md, each cross-referenced against the spec and the spl2c sources — covering division semantics, EOF handling, 64-bit integer width, Unicode output, strict structure, and more. - Unicode I/O.
Speak your mindrenders code points viachar.ConvertFromUtf32;Open your mindreads one code point at a time (matching spl2c'sgetchar);Listen to your heartis strtol-style numeric input with EOF as −1. - Interactive console (REPL). Type a sentence, event, or expression per line;
stateinspects the stage;exitquits.
Installation
Add the library to a .NET 10 project:
dotnet add package DotnetBard
using DotnetBard;
using DotnetBard.IO;
var source = """
Two.
Romeo, a young man.
Juliet, a young woman.
Act I: Counting.
Scene I: The sum.
[Enter Romeo and Juliet]
Romeo: You are as bold as the sum of a cat and a cat. Open your heart!
[Exeunt]
""";
var interpreter = new ShakespeareInterpreter(source, Settings.Basic);
interpreter.Run(); // prints 2Prebuilt self-contained CLI binaries for linux-x64, win-x64, osx-arm64, and osx-x64 are attached to this release. To build from source, clone the repo and run:
dotnet run --project src/DotnetBard.Cli -- run samples/hello_world.spl
dotnet run --project src/DotnetBard.Cli -- console
Building from source requires the .NET 10 SDK.
Sample plays
The samples/ directory holds ten example plays, each documented with expected input and output in samples/README.md:
hello_world.spl— printsHello World!primes.spl— reads a bound N and prints the primes up to Nreverse.spl— reads characters and prints them reversedfibonacci2.spl— prints the Fibonacci sequenceguess.spl— a number-guessing gameshakesbeer.spl— "99 bottles of beer"sum.spl,double.spl,max.spl,total.spl— small originals with aside comments (two-number sum, double a number, pick the larger, running total)
License
AGPL-3.0-or-later. The project contains material from spl2c (the original SPL-to-C translator, GPL-2.0-or-later), combined under AGPL-3.0 per GPLv3 §13: the vocabulary files and six sample plays. The other four sample plays are original to this project. See NOTICE for full details.