Compile against LuaJIT for bytecode generation #4

Closed
opened 2023-01-27 13:56:56 +01:00 by lucas · 1 comment
Owner

This removes one external dependency for users to care about.

The bytecode generation itself is just

  • read file into string
  • pass string through out = string.dump(string, should_strip_debug)
  • write out to file

The most popular LuaJIT crate is https://crates.io/crates/luajit.

This removes one external dependency for users to care about. The bytecode generation itself is just - read file into string - pass string through `out = string.dump(string, should_strip_debug)` - write `out` to file The most popular LuaJIT crate is https://crates.io/crates/luajit.
lucas added the
part/filetype
kind
enhancement
labels 2023-01-27 13:56:56 +01:00
Author
Owner

Preliminary code for that crate:

fn main() {
    let mut state = State::new();
    state.open_string();
    let is_strip_debug = false;
    let input = todo!("get Lua code");
    state.push(input);
    state.push(is_strip_debug);
    state.call(2, 1);
    let output = state.to_str(-1).expect("no result on stack");
}
Preliminary code for that crate: ```rust fn main() { let mut state = State::new(); state.open_string(); let is_strip_debug = false; let input = todo!("get Lua code"); state.push(input); state.push(is_strip_debug); state.call(2, 1); let output = state.to_str(-1).expect("no result on stack"); } ```
lucas added this to the Basic SDK and mod manager milestone 2023-01-27 16:21:35 +01:00
lucas added this to the Mod Manager project 2023-01-27 16:22:04 +01:00
lucas added the
crate/sdk
label 2023-01-27 16:24:21 +01:00
lucas self-assigned this 2023-02-20 16:14:45 +01:00
lucas added reference feat/dtmm 2023-02-20 16:14:55 +01:00
lucas closed this issue 2023-03-01 22:30:17 +01:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: bitsquid_dt/dtmt#4
No description provided.