An Esoteric Programming Language


"…allows you to write programs that are also bad 1980s heavy metal songs."
— Dylan Beattie


Rockstar is yet another oddball esoteric programming language, not unlike Shakespeare and Storyteller, whose aim is not merely to tell a computer to do something for you, but also to entertain the user. In this case, the code is intended to resemble the lyrics to a rock song:

FizzBuzz in Rockstar, by Dylan Beattie
Midnight takes your heart and your soul
While your heart is as high as your soul
Put your heart without your soul into your heart

Give back your heart

Desire is a lovestruck ladykiller
My world is nothing 
Fire is ice
Hate is water
Until my world is Desire,
Build my world up
If Midnight taking my world, Fire is nothing and Midnight taking my world, Hate is nothing
Shout "FizzBuzz!"
Take it to the top

If Midnight taking my world, Fire is nothing
Shout "Fizz!"
Take it to the top

If Midnight taking my world, Hate is nothing
Say "Buzz!"
Take it to the top

Whisper my world

The language was designed in 2018 by software consultant Dylan Beattie in a bar, as a joke. It was inspired by a tweet from one Paul Stovell: "To really confuse recruiters, someone should make a programming language called Rockstar"¹. Armed with "a laptop and a beer", Dylan set out to create a Turing-complete dynamically typed language meeting these requirements, wrote a parody specification and created a GitHub repository for it. He tweeted that he'd done it and presumably went to bed happy. The internet of course went wild. Before too long others had picked the idea up and run with it, writing programs, producing transpilers for other languages, creating Github issues and generally having a good time.

Dylan was of course surprised and delighted. It made the front page of Reddit, gained hundreds of stars on GitHub, was all over twitter The idea he'd had ran not just through the tech community, but the rock world; he had an email interview with Classic Rock magazine (I'm delighted with their description of him as a "boffin"). Meanwhile power users were writing power ballads with purpose, and both pushing Dylan to fix issues as well as suggesting improvements. He's given many talks about it (one of which is linked below); he's a clever and entertaining speaker and he actually sings the song code live on stage.

So how do I write a working lyric?

The language is not case-sensitive, is Turing-complete and pretty capable. I'm not going to delve too deeply into this, but just to give you an idea, here are a few elements of writing a Rockstar program. The example above shows some of the basics.

  • Output is simple. Scream works, as does whisper and shout.
  • Variables come in various flavours, all case-insensitive. There can be single words like Fire or Ice, common like my world.
  • To assign a value, simply use "is". The value is the modulo 10 of the length of a word. For example, to assign a value of 3 to a variable "fire", use Fire is ice. For the value 5, water or bittersweetness would both work (15 divded by ten leaves a remainder of 5!). The example he gives for 100 is The limit is a lovestruck ladykiller.
  • Booleans are handled with right or wrong, ok or lies. You get the picture.
  • There are features for arrays, functions, string handling and of course all the arithmetic functions, all well documented.

Dylan says that comments are neither necessary nor desirable, but he has made the concession that comments will appear in parentheses. (This is cheating, according to him.)

Finally, just in case you were wondering, floating point numbers are equally straightforward. Simply insert a period to create two sentences of "digits", so pi can be represented thus:

My heart was ice. A life unfulfilled, wakin' everybody up, taking booze and pills

Very metal, I'm sure you'll agree.




¹ Many recruiters would advertise for "rockstar developers", but offer poor working conditions and remuneration.

Dylan talking (and singing) about Rockstar
Rockstar's website
Classic Rock interview

Iron node 26

$ xclip -o | wc
681