Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucasnlm/rinha-compiler-kotlin
Rinha interpreter for "Rinha de Compiladores" using Kotlin Native
https://github.com/lucasnlm/rinha-compiler-kotlin
interpreter kotlin parser works-on-my-machine
Last synced: about 2 months ago
JSON representation
Rinha interpreter for "Rinha de Compiladores" using Kotlin Native
- Host: GitHub
- URL: https://github.com/lucasnlm/rinha-compiler-kotlin
- Owner: lucasnlm
- License: mit
- Created: 2023-09-14T03:11:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-29T02:04:21.000Z (over 1 year ago)
- Last Synced: 2024-05-02T02:22:56.143Z (8 months ago)
- Topics: interpreter, kotlin, parser, works-on-my-machine
- Language: Kotlin
- Homepage:
- Size: 7.09 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![banner]
[](https://discord.gg/e8EzgPscCw)
## Kotlin Rinha Interpreter
### About
Rinha interpreter is an interpreter for the "Rinha de Compiladores".
You can read more about it [here](https://github.com/aripiprazole/rinha-de-compiler).### How to build
This project was built using [Kotlin Native](https://kotlinlang.org/docs/native-overview.html) and [better-parse](https://github.com/h0tk3y/better-parse) to implement the Rinha grammar.
To build the project, you can use the following command:
```bash
./gradlew nativeBinaries
```You can edit / build it using IntelliJ IDEA.
### How to use
To run the interpreter, you can use the following command:
```bash
./rinhak files/print.rinha # or print.json to use the AST file
```You can also run the interpreter directly using REPL:
```bash
./rinhak repl
```### Help
You can use the following command to see the help:
```bash
./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.
Run from AST file. E.g: rinhak test.json
Run from Rinha file. E.g: rinhak test.rinha
```### Tests
To run the tests, you can use the following command:
```bash
./gradlew allTests
```[banner]: ./img/banner.png
## Docker
You can also use the docker image to run the interpreter.
```bash
docker build -t "rinha:Dockerfile" .
docker run -it rinha:Dockerfile
```