4 min read

New programming languages keep popping up every now and then, but here’s something that’s out of the box – jukebox to be precise! If you’ve ever dressed up (or at least thought of it) in leather tights, a leather jacket, with an axe strung around your neck, belting out your favourite numbers, you’re probably going to love this!

Somebody…no not Nickelback, created a language that is designed for creating computer programs using song lyrics! The language is called…hold your breath…Rockstar!

Say, what?? Are you kidding me? Is this some kind of joke/’fake news’?

No, it’s not. It’s as real as Kurt writing those songs she sang in Hole! 😉 Rockstar is heavily influenced by the lyrical conventions of 1980’s hard rock and power ballads. And the somebody who created it is Dylan Beattie, a Microsoft MVP for Visual Studio and Development Technologies. Unsurprisingly, Dylan’s a musician himself. Rockstar is already growing in popularity! Will you take a look at the growth on Github and the discussions going on on Reddit?

You ask why would Dylan do such a thing? Cos, as Van Halen would say, “Everybody Wants Some”! Well, he thought it would be cool to have such a language, where you can use your favourite lyrics to drive your computer and HR recruiters nuts! It’s mainly part of a movement to force recruiters from using the term, “Rockstar Programmers”. Did I say movement?

Rockstar supports a unique feature known as poetic literals, which allow programmers to simultaneously initialize a variable and express their innermost angst. I’m sure Billie Joe Armstrong and Axl Rose will surely appreciate this!

This is what sample Rockstar code looks like, solving the fizzbuzz problem:

Let’s start with the minimalistic version:

Modulus takes Number and Divisor
While Number is as high as Divisor
Put Number minus Divisor into Number
(blank line ending While block)
Give back Number
(blank line ending function declaration)
Limit is 100
Counter is 0
Fizz is 3
Buzz is 5
Until Counter is Limit
Build Counter up
If Modulus taking Counter, Fizz is 0 and Modulus taking Counter, Buzz is 0
Say "FizzBuzz!"
Continue
(blank line ending 'If' Block)
If Modulus taking Counter and Fizz is 0
Say "Fizz!"
Continue
(blank line ending 'If' Block) 
If Modulus taking Counter and Buzz is 0
Say "Buzz!"
Continue
(blank line ending 'If' Block)
Say Counter
(EOL ending Until block)

And now, the same thing in idiomatic Rockstar code:

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

Oh yeah, did I mention that Rockstar doesn’t care two hoots about indentation. Also, it discourages the use of comments. Why? Cos this is Rock ‘n’ Roll, baby! Let whoever wants to know the meaning, discover it on their own! Now that’s hardcore!

To declare a variable in Rockstar, you simply use a common word like “a, an, the, my or your” as a preface and any unique name (e.g. “Suzanne”).

For types, you can use words like “mysterious”, meaning no value is assigned, or “nothing/ nowhere/nobody”, for null. You could name your variable “em” so to increment it, you’d use “build em up” and to decrement it, you’d use “knock em down”. Now if that’s not cool, you tell me what is! Like in Ruby or Python, variables are dynamically typed and you don’t need to declare them before use.

That’s not all! For I/O, you’re at the liberty of using words like “listen to” or “shout,” “whisper” or “scream”. Someone actually happened to test out the error handling capabilities of Rockstar, a couple of days ago: If you accidentally typed “!love” as a property, it will return “you give !love a bad name”.

I wonder what it would do, if we just typed in the lyrics to Sweet Child o’ Mine. Nevertheless, the Github (Shooting) Stars are growing like a weed (pun intended) 😉 I suggest you Don’t Stop Believin’ in it and go check this language out! And don’t forget to tell us in the comments, about how it Rock(ed) You Like a Hurricane or better yet, Shook Me You All Night Long! 😉

Read Next

Will Rust Replace C++?

Why Guido van Rossum quit as the Python chief (BDFL)

Apollo 11 source code: A small step for a woman, and a huge leap for ‘software engineering’

I'm a technology enthusiast who designs and creates learning content for IT professionals, in my role as a Category Manager at Packt. I also blog about what's trending in technology and IT. I'm a foodie, an adventure freak, a beard grower and a doggie lover.

LEAVE A REPLY

Please enter your comment!
Please enter your name here