Rinha interpreter is an interpreter for the "Rinha de Compiladores". You can read more about it here.
This project was built using Kotlin Native and better-parse to implement the Rinha grammar.
To build the project, you can use the following command:
./gradlew nativeBinaries
You can edit / build it using IntelliJ IDEA.
To run the interpreter, you can use the following command:
./rinhak files/print.rinha # or print.json to use the AST file
You can also run the interpreter directly using REPL:
./rinhak repl
You can use the following command to see the help:
./rinhak help
Kotlin Rinha Interpreter
Usage: rinhak [options] [source file]
Options:
help Show this help message and exit.
repl Run the REPL.
rinha Run on Rinha mode.
<file.json> Run from AST file. E.g: rinhak test.json
<file.rinha> Run from Rinha file. E.g: rinhak test.rinha
To run the tests, you can use the following command:
./gradlew allTests
You can also use the docker image to run the interpreter.
docker build -t "rinha:Dockerfile" .
docker run -it rinha:Dockerfile