top | item 29476545

Rockstar: a language for programs that are also hair metal power ballads

341 points| skanderbm | 4 years ago |codewithrockstar.com | reply

67 comments

order
[+] pohl|4 years ago|reply
Check out this conference talk from December 2019 – "The Art of Code" – which culminates in a live performance of Fizzbuzz in Rockstar

https://www.youtube.com/watch?v=gdSlcxxYAA8

[+] cs702|4 years ago|reply
Anyway, so I'm watching the hugely entertaining video to which you linked, only to find that a comment I made about Rockstar on HN a long while ago is on the video: https://youtu.be/gdSlcxxYAA8?t=3226 -- totally unexpected. Brought a smile to my face. Thank you for sharing!
[+] BbzzbB|4 years ago|reply
I've just finished listening to that great talk before I searched HN to check up on the original share, surprised to see such a recent repost! I don't recall laughing out loud so often at a dev talk while it also showed some amazing snippets of, well, the art of code.

If someone has other talks of this nature to recommend (and is lost in this 7d+ post), I'm all ears.

[+] montebicyclelo|4 years ago|reply
(this (very enjoyable) talk is by the author of the linked web site)
[+] evanchisholm|4 years ago|reply
The art of code is such a good talk. I've watched it a few times and enjoy it every single time.
[+] hu3|4 years ago|reply
This is how Advent of Code day 7 solution looks like in Rockstar [1]:

    My plaything is your mind
    Cast my plaything into the void

    Listen to my heart
    Shatter my heart with the void

    Natsuki is frightened
    Yuri is gentleness
    Poems are invaluable
    Rock reality
    While my heart isn't mysterious
    Roll my heart into the world
    Burn the world into my hope
    If my hope is less than Natsuki
        Let Natsuki be my hope

    If my hope is greater than Yuri
        Let Yuri be my hope

    Let Sayori be reality at my hope
    If Sayori is mysterious
        Sayori is hereabouts

    Build Sayori up
    Let reality at my hope be Sayori
    Build poems up

    My end is justifying
    My thoughts are knowledgable
    Let the volume be poems over my thoughts
    My hope is accessible
    Turn down the volume
    Build Yuri up
    While my hope is less than Yuri
    Let my target be reality at my hope
    If my target is not mysterious
        Let the volume be the volume without my target

    If my end is nothing
        If the volume is less than my end
            Let my end be my hope


    Build my hope up

    My hope is accessible
    My passion is literature
    My heart is courageous
    Knock my heart down
    While my hope is less than Yuri
    Let my poem be reality at my hope
    If my poem is not mysterious
        Let my fear be my end without my hope
        If my fear is as weak as my heart
            Let my fear be my fear of my heart

        Let my fear be my fear of my poem
        Let my passion be my passion with my fear

    Build my hope up


    Shout my passion
[1] https://old.reddit.com/r/adventofcode/comments/rar7ty/2021_d...
[+] dane-pgp|4 years ago|reply
That's good, but I was expecting it to contain a wheel rotating in six dimensions, forty gears and a ticking clock.
[+] DonHopkins|4 years ago|reply
Is there a Rockstar => Airline Food transpiler?

https://esolangs.org/wiki/Airline_Food

>Airline Food is an esoteric programming language created by User:Largejamie in April 2021 whose programs are supposed to look like Jerry Seinfeld's stand-up.

Factorial: Takes an input from the user and outputs its factorial

    You ever notice this?
    What's the deal with airline food?
    What's the deal with it? Right? 
    So...
    Um,
    Just like it.
    Yeah, Not like this.
    Moving on...
    Um, See?
[+] amildie|4 years ago|reply
Thanks, OP, I can finally become that 'Rockstar Developer' that companies are always looking for.
[+] pipingdog|4 years ago|reply
This is why I wanted to create a project called Tenex or 10x.
[+] gordaco|4 years ago|reply
Nice to see people rediscovering this language from time to time. I wrote an interpreter for an early version several years ago, just for fun. Possibly my favourite esoteric language. I particularly love the philosophy of "if you write even a single line of Rockstar, then you can consider yourself a full-fledged Rockstar programmer" (I'm paraphrasing, but I remember something like that in some official documentation).
[+] jamespwilliams|4 years ago|reply
> Tommy used to work on the docs.

Nice

[+] jameshart|4 years ago|reply
UnionBean.onStrike();
[+] organman91|4 years ago|reply
When I originally saw the talk this line killed me. Gotta be in my top ten favorite puns I've ever seen.
[+] airstrike|4 years ago|reply
And the docs are littered with references...

> Cut my life into pieces

[+] krylon|4 years ago|reply
I was excited initially, but Hair Metal is an obvious no-go for me.

Although it could be fun to do "reverse Perl poetry", and find Hard Rock / Hair Metal songs whose lyrics are valid Rockstar code. That way, we could finally find out what that one special song really means.

    \m/ (> <) \m/
[+] dylanbeattie|4 years ago|reply
Hello. Dylan here. This is all my fault. :)

The song that I think would compile with the fewest changes to the language spec is Scorpions' "Rock You Like A Hurricane". I don't think it'd reveal any hidden meaning or anything, though... it's really just a long list of assignment statements. You need to spell 'Night' on line 2 with a capital 'N'; same with 'What' on line 4, and some liberal use of parentheses, but the first four lines do actually compile:

It's early morning, the sun comes out

Last Night was shaking and pretty loud

My cat is purring, it scratches my skin

So What is wrong (with another sin)?

The rest is, um, work in progress. And it may not be a coincidence that the stack push/pop operators in Rockstar are called "rock" and "roll", and the syntax was designed so that "rock you like a hurricane" is syntactically valid Rockstar code.

[+] erik_seaberg|4 years ago|reply
Pretty sure \m/ (> <) \m/ is the next Haskell infix operator beyond monads and arrows.
[+] kergonath|4 years ago|reply
One band absolutely needs to do that.
[+] captn3m0|4 years ago|reply
Website is blocked in India because CloudFlare has a terrible ISP in India: https://github.com/RockstarLang/codewithrockstar.com/issues/...

I wrote a thread on why this keeps happening and why CloudFlare needs to fix it: https://twitter.com/captn3m0/status/1468454402956533761

[+] dylanbeattie|4 years ago|reply
I had no idea. Thanks for spotting this; I've flipped the site over to use CloudFlare Full/strict TLS; if that doesn't work I can turn off CloudFlare proxying completely.
[+] naltun|4 years ago|reply
The author of Rockstar gave a _fantastic_ presentation called The Art of Code, where he eventually introduces the language. I cannot praise the talk enough. It is available on YouTube.
[+] motohagiography|4 years ago|reply
Awe inspiring.

I recorded a song where the lyrics were a parsable brainfuck program after wondering if a) daftpunk's higher bigger faster was turing complete, and b) whether the same was true of never gonna give you up. For me it was substituting high concept for talent, but what else are you going to do in pandemic lockdown.

Rockstar tho, this is next level.

[+] lewispollard|4 years ago|reply
I'm sorry what? Can you explain all of those things??
[+] rgrieselhuber|4 years ago|reply
I've always thought it would be cool if classical poetry turned out to be source code.
[+] spikepuppet|4 years ago|reply
Hair Metal in the title had me interested, and this didn't disappoint. Thanks OP.
[+] pluc|4 years ago|reply
> The keywords it, he, she, him, her, they, them, ze, hir, zie, zir, xe, xem, ve, and ver refer to the last named variable determined by parsing order.

that was funny. let's have more social constructs in programming languages!

[+] tzs|4 years ago|reply
I've actually seriously suggested that we make pronouns like that for English.

The conventional system with just "he" and "she" and "it" is clearly inadequate because it doesn't handle the case where you have more than one noun that should have the same pronoun. That's a very easy case to hit.

We are essentially using a 1.58-bit hash function to map nouns to pronouns, which has very poor collision resistance and it is a somewhat subjective hash function when dealing with anything whose gender you aren't sure of.

We could add a bunch more pronouns to support more bits in the hash--that's what many people who consider themselves non-binary gendered are advocating. That can solve the problem of not having enough bits in the hash, but still leaves the problem of the hash function being subjective.

In fact, it makes it more subjective because at least with "he" or "she" the default is to go by appearance unless you know that this is incorrect. With zie, zir, xem, and the rest everyone is a special case.

Position based pronouns fix the hash problem by not using a hash, and fix the subjectivity problem by not being based on any characteristics of the noun to which they refer in a given sentence.

Keep "he" and "she" with their current meaning for backward compatibility, and then add new pronouns that refer to the 1st noun in the sentence, the 2nd noun in the sentence, and so on, and add a similar set that refer to the nouns in the previous sentence (and count as nouns for determining pronouns in the current sentence).

[+] sellerie|4 years ago|reply
Wow that sample code sounds 100% like DragonForce lyrics
[+] leodriesch|4 years ago|reply
While it is probably not a very good idea to use this to code, it reminds me of something DHH once said about Ruby.

I don’t have the quote, but he said that he just loves the language because it is so fun to write for him, despite it not being the optimal language. And this alone makes him get into flow much more easily and therefore be more productive.

This alone has made me gain interest in learning Ruby. It might be slower than lots of languages out there, but backend computing power is often not the main bottleneck in your stack. Developer velocity is probably much more important when it comes to producing great software and moving fast.

[+] bcrosby95|4 years ago|reply
This is how I look at vim. I don't think typing speed really matters for development. But I just find it so fun to see how much I can target exactly the chunk of code I want to change. It turns coding itself into a game.
[+] setpatchaddress|4 years ago|reply
Kind of a tangent, but Ruby-is-slow was always contextual. Ruby was always hugely faster than complex bash scripts for the same task. If you value launch time, Python (at least through 2.x) was always slower from a cold launch compared with Ruby.
[+] gfalcao|4 years ago|reply
I have not laughed to genuinely hard in a LONG LONG time, everything about this programming language rocks! (yes I did it)
[+] a9h74j|4 years ago|reply
Do heavy metal lyrics in other spoken languages use postfix?

How does noun placement affect the poetics/performance of metal?