๐Ÿ“ฆ chikaku / nad

Incomplete Lua VM written in Rust

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching
๐Ÿ“ฅ Clone https://github.com/chikaku/nad.git
HTTPS git clone https://github.com/chikaku/nad.git
SSH git clone git@github.com:chikaku/nad.git
CLI gh repo clone chikaku/nad
Kevin Chen Kevin Chen chore: add README ded2930 4 years ago ๐Ÿ“ History
๐Ÿ“‚ dev View all commits โ†’
๐Ÿ“ src
๐Ÿ“ tests
๐Ÿ“„ .gitignore
๐Ÿ“„ Cargo.lock
๐Ÿ“„ Cargo.toml
๐Ÿ“„ README.md
๐Ÿ“„ README.md

Nad

Incomplete Lua VM only bytecode is supported for now

Usage

  • Dump function prototype
cargo run -- -dump -debug /path/to/bytecode
# or
cargo install nad
nad -debug -dump /path/to/bytecode

  • Execute bytecode file
cargo run -- -debug /path/to/bytecode
# or
cargo install nad
nad -debug /path/to/bytecode

  • Use nad library
use nad::State;
use nad::Reader;

fn main() {
    let path = "/path/to/bytecode";
    
    // read prototype
    let prototype = Reader::from_file(path).prototype();
    
    // execute main function
    State::from_file(path).call(0, 0);
}

TODO

  • Metatable
  • Iterator
  • Error handler
  • ...