2 releases

0.1.1 Jun 10, 2023
0.1.0 Jun 10, 2023

#612 in Programming languages

31 downloads per month

MIT license

4KB

Luar

Luar is a Lua interpreter implemented in Rust. It aims to provide a high-performance, reliable interpreter that supports as many Lua features as possible.

Features

  • Basic capabilities for parsing, compiling, and executing Lua code

  • Highly configurable with support for custom Lua standard libraries

  • Purely implemented in Rust, providing high performance and safety guarantees

  • Easy to embed into Rust applications

Installation

To use Luar, you need to have Rust programming language and Cargo package manager installed. Please refer to Rust's official website for installation instructions.

Use the following command in the terminal to install Luar:

$ cargo install luar

Usage

Command-line Interface

If you want to run an interactive Lua shell, execute the following command:

$ luar

To run a Lua script, execute the following command:

$ luar script.lua

In Rust Applications

You can also integrate Luar into your own Rust projects. Add the following dependency in your Cargo.toml file:

[dependencies]
luar = "0.1"

In your Rust code, use the following code to load and run a Lua script:

use luar::State;

fn main() {
    let mut lua = State::new();
    lua.load("print('Hello, world!')").exec().unwrap();
}

Refer to the documentation for more detailed explanations.

Contributing

Contributions to Luar are welcome! If you have any suggestions or questions, please open an issue or pull request on GitHub.

License

Luar is distributed under the MIT License. Please refer to the LICENSE file for more information.

Dependencies

~395KB