tinylj

Crates.iotinylj
lib.rstinylj
version0.1.3
sourcesrc
created_at2023-06-21 19:31:59.827392
updated_at2023-06-21 20:07:40.218988
descriptionRust crate for calling LuaJIT from Rust
homepage
repositoryhttps://github.com/zatrit/tinylj/
max_upload_size
id896465
size54,910
(zatrit)

documentation

README

TinyLJ

Github

Fork of luajit-rs

Crate for interfacing with LuaJIT from Rust, for running high-performance Lua code that can integrate with native-code written in rust.

Getting Started

use tinylj::{c_int, State, lua_fn};

fn return_42(state: &mut State) -> c_int {
    state.push(42);

    1
}

pub fn main() {
    let mut state = State::new();
    state.open_libs();
    state.do_string(r#"print("Hello world!")"#);

    state.push(lua_fn!(return_42));
    state.set_global("return_42");
    state.do_string(r#"print(return_42())"#);
}
Commit count: 33

cargo fmt