The luau Plugin loads a Script Headless (#75) #79
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/cinnabar#79
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#75
What to build
A
luauPlugin that stands up Headless, hosts one Luau VM, and runs a Script handed to it as bytes. The Plugin publishescinnabar.script/1withload(self, name, source: Byte_Span) -> boolandunload(self, name) -> bool, requires no other Interface, and works with no Backend and no Platform. The VM is created inregisterand closed inshutdown. A Script is one chunk compiled and run in a fresh environment table so two Scripts do not share globals.printandwarnare rebound to the engine logger at info and warning levels.Every entry into the VM goes through
pcall; a failure logs the message and traceback under the Plugin's logger and the call returns. A Script that fails to compile, or fails while running its chunk, is rejected andloadreturns false. Every Luau C callback is aproc "c"that establishescontextfrom the Engine pointer it recovers from the VM before calling Odin (ADR-0008) and raises errors only as its last statement (ADR-0015).Acceptance criteria
luauPlugin initialises, ticks, and shuts down with no Backend and no Platformloadwith a Script whose chunk callsprintproduces an info log line;warnproduces a warningloadwith a Script that fails to compile returns false and logs the compiler messageloadwith a Script whose chunk raises at runtime returns false and logs the message with a Luau tracebackunloadof a loaded name returns true; of an unknown name returns falsepackageslist and the suite intests/luaudrives it with Luau source strings onlyBlocked by