Skip to content

doukutsu-rs/lua-ffi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luajit RS

Documentation

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

Getting Started

#[macro_use]
extern crate luajit;

use luajit::{c_int, State};

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())"#);
}

About

More or less safe Lua bindings for Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published