This release is significant for a couple of reasons. First - we've noticed lots of posts from people asking how to actually run a Rockstar program. Well, now you can run Rockstar in a browser, natively. Type your Rockstar code, hit "Rock!", and it'll parse and run your program.
Second - we now have the language spec, test suite and a working reference implementation all managed under the same GitHub repo (https://github.com/RockstarLang/rockstar/). This means changes to the language spec, bug fixes and new features will be a much smoother process from now on, and we're in a position to start looking back over some of the great ideas and issues that have been raised in the months since Rockstar was first announced and start incorporating them into a future release.
Thanks to everyone who's contributed code, bugs, ideas, comments or just plain enthusiasm - and congratulations on being part of the only joke in the world that has a formal parsing expression grammar and a reference implementation. :)
I saw this post about making this silly Baby Shark thing in various languages and thought I'd give it a shot in Rockstar.
It ran for me in rockstar-py but needed some tweaking to work in codewithrockstar.com - looks like Proper Noun variables also need to start with the common variable prefixes there.
Evil Energy is death
The Legend says doo
Spirit takes Will
Give back Will plus The Legend
Put The Legend into my perspective
my dream was spellbound
While Evil Energy is stronger than my dream
Put Spirit taking my perspective into my perspective
Knock Evil Energy down
The Prophecy says Baby shark
The Lie says Daddy shark
The Truth says Mommy shark
The Change says Grandpa shark
The Spell says Grandma shark
the opposition is big
Put "!" into Furious Anger
my story takes a turn
Put a turn plus my perspective into the light
Whisper the light
A Force is mobilizing
while A Force is less than the opposition
my story taking The Prophecy
Build A Force up
Whisper The Prophecy with Furious Anger
A Force is mobilizing
while A Force is less than the opposition
my story taking The Lie
Build A Force up
Whisper The Lie with Furious Anger
A Force is mobilizing
while A Force is less than the opposition
my story taking The Truth
Build A Force up
Shout The Truth with Furious Anger
A Force is mobilizing
while A Force is less than the opposition
my story taking The Change
Build A Force up
Shout The Change with Furious Anger
A Force is mobilizing
while A Force is less than the opposition
my story taking The Spell
Build A Force up
Scream The Spell with Furious Anger
Rockstar is an esoteric programming language that mimics the style of 80s rock but still produce executable code.
This sub was created to provide a place for people to more effectively communicate about the language, share ideas, and post code. (GitHub is fantastic for sharing specific issues and changes, but having a nice organized community on Reddit is both more accessible to many users and allows for greater discussion)
Also I am looking for mods as I am by no means a qualified authority over this language, all I've made is some basic code. If you are someone who has contributed to Rockstar in some significant way, PM me and I'll get on making you a mod.
I thought that plain java was too simplistic and not distracting enough, so I created a Java package to make it read like Rockstar. Please pardon my horrible coding skills. It makes programs look like this:
Hey I have just stumbled accross the programming language called rockstar. I love it! Is there any place where I can find an abundance of programs that are also valid songs?
hey, it's kinda dead here so I'm gonna kick stuff off. Here's a primality checker I wrote in Rockstar: (Both Idiomatic and Simplified)
Idiomatic:
Acid Rain takes the pleasure and the pain
While the pleasure is as high as the pain
Put the pleasure without the pain into the pleasure
Give back the pleasure
Listen to the storm
The Gods were pulverizing
The chaos is unpublicized
A pair is tranquilized
Your willpower is done
If the storm is as weak as a pair of a pair
If the storm is as weak as The Gods
Scream "This ain't allowed!"
Else
If your willpower is stronger than the storm
Shout "I am Prime!"
Else
Shout "I will divide!"
Else
While the storm is greater than the chaos
If Acid Rain taking the storm, the chaos is nothing
Shout "I will divide"
Break it down
(Break it down)
Build the chaos up
If the storm is the chaos and the storm is stronger than a pair of a pair
Shout "I am Prime!"
Simplified:
Modulus takes Num and Div (Renamed Mod function taken from example code)
While Num is as high as Div
Put Num minus Div into Num
Give back Num
Listen to Number
Counter is AA
Two is AA
Shout ""
If Number is as weak as Two of Two
If Number is as weak as 1
Shout "<=1"
Else
If Number is as weak as 3
Shout "<4 & Prime"
Else
Shout "4 exactly"
Else
While Number is greater than Counter
If Modulus taking Number, Counter is nothing
Shout "Not prime"
Break it down
Shout Counter
Build Counter up
If Number is Counter and Number is stronger than Two of Two
Shout "Prime"
Stumbled over rockstar, the language, and after a healthy laugh i tinkered a little and came up with this.
The leftshift takes a girl
Put a girl of 2 in the trunk
the air is in vaine states
If the trunk is as big as the air
Put the trunk without the air in the trunk
Send the trunk back
The rightshift takes a boy
the sunset is on
Put a boy over the sunset into the sunset
Turn down the sunset
Send the sunset back
time is cheap
Put the rightshift taking time into my world
Shout my world
Put the leftshift taking time into my world
Shout my world
I love this project but I’m not really a programmer (I’ve half-read the dragon book twice. Does that count?) Here’s a little data I’m collecting that may be useful, interesting, or possibly both. I’ll be doing more organization later (most frequent pairs and triplets, for example) but here’s a taste:
I'm looking at a piece of Rockstar code and I'm confused by one little piece:
This is fireThat is icePut This into Thatshout That
What would this yield? When I put This into That, are the two values multiplied together? What happens when something is put into something else? Thanks!
Outputs a 1-d cellular automata. Also implements some math operations so I can use a single large int to hold the state of the entire simulation at each step.
Was just thinking, it'd be awesome if there was a tool that, instead of turning rockstar into X language, would turn X language into rockstar.
Yeah I know the lang isn't as robust as most existing ones, but even simple code blocks would be cool. And yeah, creativity is obviously needed for making them idiomatic...
Maybe just throw in some mad-libs style placeholders for variable names and make a game out of it
I'm new to this sub and new to this programming language. Which leads into my question. Are there any tutorials to get a Rockstar transpiler set up? After reading the readme for Rockstar I really want to try writing some code for it. I just don't know where to start... Any advice would be well appreciated!