You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a Luau CLI user, I would find it handy if the CLI application had an option to output a binary bytecode blob, so that it would be easier to achieve interoperability between programs. The binary format would be far easier for a 3rd-party program to parse compared to the textual representation that is currently dumped. Of course, this need not be the default behaviour of the CLI.
For example, I could use the Luau CLI like this: luau --compile --binary script.lua > bytecode.luac
And following this, there would be a bytecode.luac file created, containing the bytecode as given by Luau::Compiler::compile.
Another interesting idea could be to allow the loading and execution of precompiled binary bytecode blobs.
The text was updated successfully, but these errors were encountered:
We definitely need a way to compile bytecode in CLI. I'm now thinking that maybe --compile should actually be reserved for outputting a binary bytecode blob? We can probably find another command line to print the text representation, or maybe require another flag. We could also go with --binary I suppose, one caveat is that for compiling bytecode to stdout we need to process just a single file, whereas disasm can work on multiple files which is somewhat useful to be able to analyze large portions of Luau code by compiling the entire folder and processing the result with regex/etc.
I don't think we'll ever support direct loading of bytecode. Bytecode is not verified during loading; applications that want to support loading from bytecode are expected to verify that the bytecode never comes from untrusted sources, for example by signing it with asymmetric cryptography. It's trivial to load the bytecode directly on the application level, but CLI supporting it is not a great idea.
As a Luau CLI user, I would find it handy if the CLI application had an option to output a binary bytecode blob, so that it would be easier to achieve interoperability between programs. The binary format would be far easier for a 3rd-party program to parse compared to the textual representation that is currently dumped. Of course, this need not be the default behaviour of the CLI.
For example, I could use the Luau CLI like this:
luau --compile --binary script.lua > bytecode.luac
And following this, there would be a
bytecode.luac
file created, containing the bytecode as given byLuau::Compiler::compile
.Another interesting idea could be to allow the loading and execution of precompiled binary bytecode blobs.
The text was updated successfully, but these errors were encountered: