quarkiverse / quarkus-bon-jova-rockstar

An implementation of Rockstar as a JVM language
https://codewithrockstar.com/
3 stars 2 forks source link
quarkus-extension

Bon Jova

An implementation of Rockstar as a JVM language

Rockstar is an example of an “esoteric language,” designed to be interesting rather than intuitive, efficient or especially functional. Rockstar’s interesting feature is that its programs use the lyrical conventions of eighties rock ballads. Rockstar has been implemented in many languages, but not as a JVM language. (There are existing Java implementations, but they rely on interpretation, rather than compilation to bytecode.) This is clearly (clearly!) a gap that needed fixing.

This implementation uses the Antlr grammar for Rockstar by Andreas Scheja as a starting point.

Using the extension

Create a Quarkus app, and add the extension to your pom; it will then compile .rock files from src/main/rockstar and any other <sourceDirectory> defined in the pom.xml.

Developing the extension

Getting started

In the top-level directory, run

mvn install

This will build the Rockstar parser, the Quarkus extension, and the sample app. You can then run the sample app with

cd samples
mvn quarkus:dev

(To test out your local extension changes, make sure to change the extension version in the app pom to -SNAPSHOT.)

IDE integration

After cloning the repo, you will need to run mvn compile in the bon-jova-rockstar-compiler folder to generate the Antlr Java classes, or your IDE will report compile failures and missing classes. (A top-level mvn install will also work.) The generated classes will appear in target/generated-sources, so you may also need to configure your IDE to treat that folder as a generated sources folder.

What's implemented

See the spec for details and the definitive list of capabilites. Some of these may work but have not been validated with tests.

General

✓ Variables and constants

✓ Types

Arrays

Queue operations

Splitting and joining strings

✓ Casting

✓ Single quotes

Number operations

✓ Comparison and logical operations

✓ Input and output

✓ Flow control