Optional lua-rs backend: run scripts on a pure-Rust Lua VM (behind a feature flag)#89
Open
ianm199 wants to merge 1 commit into
Open
Optional lua-rs backend: run scripts on a pure-Rust Lua VM (behind a feature flag)#89ianm199 wants to merge 1 commit into
ianm199 wants to merge 1 commit into
Conversation
Adds a `lua-rs` feature that swaps the C-FFI `hlua-badtouch` bindings for
`lua-rs-hlua-shim`, an hlua-compatible API backed by the pure-Rust lua-rs
Lua 5.4 VM. Default build is unchanged (`default = ["hlua-badtouch"]`); the
swap is a single cfg'd import in src/lib.rs.
Build/run on lua-rs with:
cargo build --no-default-features --features lua-rs
Verified: all 24 lib tests pass on lua-rs, and `authoscope run` produces
byte-identical output and exit codes vs the C-hlua build for compute
(hmac/hex/base64/json) and live HTTP basic-auth, valid and invalid creds.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2c8f139 to
50f228a
Compare
Author
|
@kpcyrd Made the change here and it seems to pass your tests still! Going to spend some more time looking into it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft / experimental — following up on the Reddit thread where you mentioned authoscope and sn0int. This wires authoscope's Lua scripting onto a pure-Rust Lua 5.4 VM behind an opt-in flag, so it's easy to try without touching the default build.
lua-rsfeature that swaps the C-FFIhlua-badtouchbindings forlua-rs-hlua-shim, an hlua-0.4-compatible API backed by the lua-rs VM.default = ["hlua-badtouch"]— the normal build is unchanged.#[cfg]'d import insrc/lib.rsplus the optional dep.runtime.rs, the 47 host functions, and every.luascript are untouched.#![forbid(unsafe_code)], so the class of "weird memory issues across the FFI" you mentioned is gone for that part.authoscope rungives byte-identical stdout + exit codes vs the C-hlua build for hmac/hex/base64/json and live httpbin basic-auth, on both valid and invalid creds. Try it:cargo build --no-default-features --features lua-rs.