-
Notifications
You must be signed in to change notification settings - Fork 15
API: Compile strings and Create/control Luau VMs #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah, this kinda stuff belongs in the |
what's the scope of the |
Probably? it's less obvious imo. |
Would an API like Lune's be okay? local luau = require("@lune/luau")
-- Compile the source to some highly optimized bytecode
local bytecode = luau.compile("print('Hello, World!')", {
optimizationLevel = 2,
coverageLevel = 0,
debugLevel = 1,
}) local luau = require("@lune/luau")
local bytecode = luau.compile("print('Hello, World!')")
local callableFn = luau.load(bytecode, {
debugName = "'Hello, World'"
})
callableFn() I don't really see any improvements or flaws with this API. |
I think that lune's API of compile and load is perfectly reasonable for what should be provided in |
I think luau.load has the whole "malicious input leads to RCE" problem which I think precludes directly exposing it unless the concern is ignored |
Yeah, I guess there's an important detail that we should probably clarify: if |
This partially resolves the features I'd like to see out of #85 when it comes to loading bytecode but going forward I'd like to see the ability to add hooks or control external luau states
I think that there should be a way to override this. Basically a way to say "I know what I'm doing, please let me load arbitrary bytecode". |
I think this issue is completed now? cc @aatxe |
This is at least somewhat implemented now. We can open additional tickets targeting the addition of specific features here. |
This partially resolves the features I'd like to see out of luau-lang#85 when it comes to loading bytecode but going forward I'd like to see the ability to add hooks or control external luau states
A useful API to have for the runtime. I'd like to have an API which allows people to create and control Luau VMs from inside Luau but I think a
loadstring
-like API is sufficient (obviously not using the global name loadstring)The text was updated successfully, but these errors were encountered: