Unicode esoteric language

Stac[K]oda

Music you can execute. Notes become values, phrasing becomes control flow, and a ten-row staff becomes a stack machine.

10staff rows
3note families
UTF-8source files
0runtime dependencies

Pitch becomes state

A score is a program

Stackoda reads source from left to right across one or more systems. Vertical position supplies a value; notation decides what happens to it.

Quarter notes push

A note pushes its row value. Notes aligned in one column form a chord and push their sum.

Eighth notes operate

Ten selectors cover arithmetic, stack manipulation, character output and integer output.

Half notes communicate

Comparisons, logical not, integer input and character input share the same pitch system.

Score explorer

Read real Stackoda

Each selection below is a valid program from the reference repository.

This page bundles Noto Music for complete musical glyph coverage. The explorer keeps every logical source cell at a fixed width. Font license.

chord.staff

          

The staff is visually aligned for reading. Use Copy score for the exact UTF-8 source.

Advanced example

99 Bottles, one loop

The complete song is generated by a single 99-pass repeat. The current count stays on the stack while conditionals select singular, plural and no more; the final verse executes after the loop.

99loop passes
1,023instructions
46,365executed steps
43staff systems
stdout ยท excerpt
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.

                         ยทยทยท

1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, no more bottles of beer on the wall.

No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.

Cross-esolang encore

Rockstar composes the score

An optional Rockstar 2 program turns a lyric into executable sheet music. Rockstar writes the .staff file; Stackoda reads the notes and prints the original lyric.

Rockstar lyricscomposer source Stackoda scoregenerated notes Hello from Rockstar!program output
Rockstar โ†’ Stackoda
$ rockstar composer.rock "Hello from Rockstar!" \
  > generated.staff
$ stackoda generated.staff
Hello from Rockstar!

Beyond arithmetic

Musical structure carries runtime state

โ™ฏ โ™ญ โ™ฎAccidentals update row offsets
|Barlines restore the key signature
๐„† โ‘  โ‘ก ๐„‡Repeats select numbered endings
๐„‹ ๐„‰ @ ๐„ŒD.S. replay can jump to a coda

Reference implementation

Write your first score

The repository includes the interpreter, fourteen examples, a complete language specification and more than one hundred generated conformance programs.