“Hello, World”

“Hello World” in Rockstar looks like this:

print "hello world" (prints: hello world)

Printing things isn’t very rock‘n’roll, though. Rockers don’t print, they scream, shout, or maybe just say things, so these are all valid aliases for print:

Scream "Hello Cleveland!" (prints: Hello Cleveland!)
Say "All I wanna know is..." (prints: All I wanna know is...)
Shout "Are you ready to rock?" (prints: Are you ready to rock?)

print adds a newline to the end of the output. If you don’t want this, use write or the alias whisper:

Write 1. Write 2; write 3!
(writes: 123)

Write "A dream "
Print "of dolphins"
(prints: A dream of dolphins)

Almost everything in Rockstar is case-insensitive, and most whitespace is ignored:


  scream "hey!"

Rockstar statements end with a newline, or with any of the punctuation characters .?!;

Say 1. Say 2? Say 3! Say 4; say 5...
(prints: 1
2
3
4
5)

Comments

The use of comments in Rockstar programs is strongly discouraged. This is rock’n’roll; it’s up to the audience to find their own meaning. If you absolutely insist on commenting your Rockstar programs, comments should be contained in parentheses (). Yes, this means you can’t use brackets in arithmetic expressions and may need to decompose complex expressions into multiple evaluations and assignments.

Line comments

You can also use the # character to indicate a comment. Line comments last until the end of the line.

If any of you lot is actually unhinged enough to want to install Rockstar scripts on your machine and run them using the Unix hashbang #!/bin/rockstar syntax, I’m not going to stop you.

ChordPro comments

Since Rockstar programs are song lyrics, it stands to reason you might want to include the chords for your programs, so aspiring rockstar developers can play along at home, so Rockstar will also allow comments to be surrounded by { } and [ ]

#!/bin/rockstar

{title: The Rockstar Blues}
{artist: Dylan Beattie}
{tempo: 120bpm}

{start_of_verse}
[A] Say "it's one for the money"
[A] Say "it's two for the show"
[D] Say "three to get ready"
[A] Say "now go go go"
{end_of_verse}

{start_of_chorus}
[D] Say 5? [D] Say 6? [A] Say 7? [A] Say 8!
[E] Say 9; [D] Say 10!
[A] Say 11
Say "and that's the Rockstar 12 bar blues"
{end_of_chorus}

Running this program through the ChordPro system produces this:

ChordPro example