https://github.com/ncharlton02/aurora
A lua interpreter written in rust
https://github.com/ncharlton02/aurora
crafting-interpreters interpreter lua luajit rust
Last synced: about 1 year ago
JSON representation
A lua interpreter written in rust
- Host: GitHub
- URL: https://github.com/ncharlton02/aurora
- Owner: ncharlton02
- License: mit
- Created: 2018-08-20T14:58:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-10T20:38:16.000Z (over 6 years ago)
- Last Synced: 2025-02-28T11:24:47.825Z (over 1 year ago)
- Topics: crafting-interpreters, interpreter, lua, luajit, rust
- Language: Rust
- Size: 96.7 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aurora (WIP)
[](https://travis-ci.com/DevOrc/aurora)
A lua intepreter written in rust. There is currently little documentation
due to the early stage of this project.
## How to run
Aurora can run in two modes, file and console. File mode will run a file in the assets folder whereas console mode will run an interactive interpereter in the terminal.
To run file mode run:
```cmd
$ cargo run --example=file -- -f=FILE_NAME_HERE
$ cargo run --example=file -- -f=basic
```
To run console mode run:
```
$ cargo run --example=console
```
To see the tokens and the raw AST use the verbose flag:
```cmd
$ cargo run --example=file -- -v -f=basic
```
**Note**: Flags do not work in the console version!
## Features
Aurora is currently a WIP. Lots of the lua language
isn't supported. See below for the currently supported and planned features.
### Implemented Features
- Comments
- If statements
- Print statements
- Basic arithmetic
- Functions
- While loops
- For loops
- Local variables
- Basic error messages with line numbers
- Tables
- Modules
### Planned features
- Rust/Lua interops
- For in loops
- A std library
- Order of Operations
- Library to run files
- Basic concurrency
### Known Problems
The expression parser is very buggy so I don't recomend writting complicated expressions
like
```lua
local x = (5 - ((8 - 9) / 3.14) - (9 - 3) * 7)
```
### Want to contribute?
Please do, there is a lot of areas that need work!
A good place to start would be testing, examples, or the expression parser.
If you have any questions, don't be afraid to ask.