luar
luar copied to clipboard
Just an attempt to write yet another LUA interpreter / JIT compiler. Kinda want to look into compiler design and dynamic language / VM optimizations
Luar — an attempt to make an optimizing lua compiler
The project consists of several crates:
lexhouses the lexer and lexing constructs, such asStringLiteral,NumberLiteralandIdentsyncontains the parser and language constructs definition as rust structserrora hierarchy of error types common in different lua runtimesast_vma runtime that executes AST coming directly from the parser (syn)reggiea register based VM and an optimizing compilernon_emptya Vec that cannot be emptytest_utiljust a few helper structs/functions for testingtestsintegration tests and benchmarks
Running the thing
cargo run --bin reggieto launch REPL of register based VM (relevant version)cargo run --bin reggie <filename>to execute file in register based VMcargo run --bin reggiecwill compile lua module from stdin and display internal bytecode and metadatacargo run --bin ast_vmto launch REPL of AST interpretorcargo run --bin ast_vm <filenameto execute file in AST interpretor