▲ | ChocolateGod 2 days ago | ||||||||||||||||||||||||||||||||||
When they had the Luau beta regions up and running I gave it a whirl and it seemed performance was greatly improved over the old Mono system. Clicking "Save" was near instant to execute, great improvement to clicking save and waiting 10 seconds to know whether or not there's an issue in your script. The only desire I have is if they could adopt FiveM-style helper functions which help wrap coroutines, namely being CreateThread(fn) and Wait(ms) (wrapper around yield inside that "thread") and Await/Promises (seems like someone already made an implementation for Luau? https://github.com/evaera/roblox-lua-promise) FiveM adopting these makes it easy to make better performing scripts without having to mangle coroutines, which is vital given the Lua VM has to finish its current task before the frame is allowed to render. https://github.com/citizenfx/fivem/blob/master/data/shared/c... | |||||||||||||||||||||||||||||||||||
▲ | HaroldCindy 2 days ago | parent [-] | ||||||||||||||||||||||||||||||||||
I'm the contractor responsible for SL's Luau VM integration, appreciate the kind words about the Luau integration! We're still in figuring out our async strategy for user-facing APIs to be honest, so these references are super helpful. We already have preemptive scheduling of execution, but it's most likely to be some kind of wrapper around `coroutine.create()` where an event loop is responsible for driving execution flow and internal `coroutine.yield()`s let you specify what you're `await`ing. We'll likely have an RFC for how that will all work within the year, but several users have written their own bespoke `async` / `await` implementations for SL in Lua already. | |||||||||||||||||||||||||||||||||||
|