Rockstar
Programs read like 1980s power-ballad lyrics, and numbers hide in the lengths of words.
Dylan Beattie, 2018 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 4 known programs · Hello World on Try It Online: identical except the line end · Test method
Run it
The idea
Recruiters love job adverts for "rockstar developers". In 2018 someone joked on Twitter that a language called Rockstar would really confuse them. Dylan Beattie took the joke seriously and built it. If the language is easy to learn, the logic goes, anyone can call themselves a Rockstar developer.
Read the story
The syntax borrows from verbose languages like COBOL and from hard-rock clichés. Variables can be named my heart or Johnny B. Output is Say, Shout, Whisper or Scream. Comparisons can be is stronger than.
Its best trick is the poetic literal: a number written as a phrase, where each word's length is one digit. This lets a program assign real numbers while still reading as a lyric. Rockstar 2.0 came out in November 2024 and reworked much of the grammar, but kept the spirit.
The machine
A dynamically typed imperative language: numbers, strings, booleans, mysterious (undefined), null, arrays and functions.
| Code | Means |
|---|---|
my heart, the night, your love | Common variables: a, an, the, my, your, our plus a word |
Johnny B | Proper variable: capitalised words |
it, he, she, they | Pronouns: the variable last assigned |
Put 3 into my guitar / Let my guitar be 3 | Assignment |
My dream is a restless engine | Poetic number: word lengths 1, 8, 6 give 186 |
My name says hello world | Poetic string: the rest of the line |
Build my guitar up / Knock my guitar down | Add 1, subtract 1 |
with, without, of, over | +, −, ×, ÷ (plus, minus, times work too) |
is greater than, is less than, is as big as | Comparisons (as big as means ≥) |
If ..., While ..., Until ... | Blocks, ended by a blank line |
Say X, Shout X, Whisper X, Scream X |
Poetic number rules: word lengths are taken mod 10, so a 10-letter word is 0. Hyphens count as letters, apostrophes do not.
Example
Lyrics of my own, not from any song:
Lyrics of my own, not from any song:
The night is a restless engine
Shout the night
Put 3 into my guitar
Build my guitar up
While my guitar is greater than 0
Say my guitar
Knock my guitar down
Say "the end"
a restless engine has word lengths 1, 8, 6, so the night is 186, and it is shouted. The guitar starts at 3 and is built up to 4. The loop prints 4, 3, 2, 1, and the blank line closes it. Output: 186, 4, 3, 2, 1, the end.
Run it
This implementation runs Rockstar 1.x, the version the Satriani reference interpreter runs, not 2.0.
This implementation runs Rockstar 1.x, the version the Satriani reference interpreter runs, not 2.0.
The example above.
A function: takes names its arguments, Give back returns, and the blank line ends the body. taking calls it.
Listen to reads one line of input into a variable. with adds, and adding to a string joins.
A poetic string: everything after says is the text.
What this implementation leaves out: arrays (at, Rock, Roll) and Split and Join, which need them.
Patterns it teaches
- Camouflage: the disguise is a genre of writing, like Shakespeare and Chef, but the language is far more practical than either.
- Encoding tricks: poetic literals store digits in word lengths. The same number has endless spellings.
- Every text runs, almost: Rockstar is permissive enough that many English sentences parse, which is part of the joke. Not all do, so it falls short of the pattern.
Try this
- Write a poetic number for 42 and for 3.14 (a period in the phrase is the decimal point).
- Write FizzBuzz in Rockstar so that it reads as a song.
- Hard: find three different phrases that all give 718, and pick the one that sounds best.
Further
- esolangs.org/wiki/Rockstar
- Official site, documentation and an online interpreter: codewithrockstar.com
- Source and spec history: github.com/RockstarLang/rockstar
See also
Pseudonatural
Write your own in Run Convert a program from Rockstar
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: rockstar.
Command line
shib run rockstar -e 'Say "Hello, World!"'shib manual rockstarSource
- Module
langs/tio/ports.js- Interpreter
langs/tio/rockstar.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org