This is part of Rhue's insides. If you just want to run scripts from Rust, use rhue, it's the only crate whose API is meant to stay stable. Everything else (this one included) can change between minor versions.
What's in here:
InstrandOp— the instruction encoding. The opcode's in the low byte like Luau's, thenA,B,C(orBx/sBx, or a 24-bit jump)Proto— one compiled function: code, constants, spans for every instruction, nested prototypes, debug info, table templates.disassemble()gives you a listingverify— checks a prototype before the VM runs it: registers in bounds, constants the right type, jumps landing on real instructions, thetopprotocol, captures that exist. Bad bytecode gets refused instead of panicking the VMto_bytes/from_bytes— the saved-chunk format (with the source text, so errors still point at lines, and optionally the chunk's types). Loading only checks the shape of the bytes, runverifyon whatever you loadarith— the arithmetic, shared by the constant folder and the VM so a folded2 ^ 0.5and a computed one are bit-for-bit the same
A listing looks like this:
function sq (3 instructions, 0 constants, 2 registers, 1 params)
0 MUL R1 R0 R0
1 RETURN R1 1
2 RETURN R0 0
License
MIT or Apache-2.0, same as the rest of Rhue.