Home

Advent of Code, Rockstar edition

2025-12-06

Background

At Øredev I met my pal Fredrik, who told me about this presentation he had just been to. It was about a fun programming language called Rockstar, which lets you write 80's rock ballad lyrics that compile. Fun! One faithful evening a few weeks later, after the rest of the family had gone to bed, I decided to have a couple of beers and give it a try.

The code

Since we're approaching Christmas, it only felt appropriate to use the first Advent of Code puzzle as my first assignment. I signed in, read the instructions, and immediately decided to cheat and solve the problem in a more familiar language first. I wrote a quick JavaScript solution, verified the output, and moved on to Rockstar. Conveniently there's an online editor and interpreter right on the Rockstar website, so I was able to get started without downloading a single thing.

Rockstar was a little awkward to get used to, I basically jumped back and forth between the documentation and the online editor, slowly building up the same solution I had just written in JavaScript. Some of the examples in the documentation made no sense at all, as there are several quirky language features made specifically to enable coding in somewhat natural language. Other challenges included things like having to implement a crude modulo function of my own, since very few rock songs are about modulo operations.

I wrote the implementation in a clear style first, with clear variable names etc, and then had a bit of fun trying to dress it up as more of a rock song. I'm not really an expert in either esoteric programming languages, coding puzzles, or rock lyrics, so it's probably neither the best solution nor the best rock song, but at least it works!

So, without further ado, here's my solution to the first puzzle of Advent of Code 2025, written in Rockstar:

Magic is found everywhere
Space is like a rocketship, rocketship
The truth is empty
The west is empty
Rock them with like glitter horses!

The reaper takes the lover and the scythe
Let judgement be the lover
When judgement is weaker than nothing
Let it be nothing without it
Let the jester be right
Yeah
While judgement is as strong as the scythe, judgement is without the scythe, baby
If the jester is right let judgement be nothing without judgement
Give judgement back!

Listen to the word!
Until the word is gone
Roll the word into heading
Cast the word with like a loneliness
The force is bittersweet
When heading is the west, the others are like us
Put the force without them into the force, baby
Let progress be magic with the force of the word
Put progress into magic
The stars are like electricity
When magic is higher than space without the stars or magic is weaker than nothing,
let magic be the reaper taking magic & space, yeah!
When magic is empty, build the truth up, baby
Listen to the word
Yeah

Say the truth!

I had fun writing this, and I'm weirdly tempted to do it again, but I'm not making any promises. Maybe if I find myself with another evening on my own and a couple of cold beers at hand ...