Closed Reinitialized closed 4 months ago
The current compile.luau that uses Yueliang is actually not in use anywhere in the codebase as of right now. The plan is to use it for LocalScripts. At the time of adding the file I was planning on using Yueliang with FiOne to compile and interpret LocalScripts, but I've changed my mind (because my goal is to have near 100% compatibility with normal Roblox script behavior).
As of right now I'm going to use Fiu to interpret scripts, but I'm not 100% sure how I want to compile them. I'm not planning on writing an opensource backend for OpenSB, so I'd rather have all the compiling done inside of Roblox (something like LuauCeption is too big, but it might still work).
If LuauCeption doesn't work for OpenSB (and if there's no other good alternative, perhaps an unoptimized Luau compiler) I might write an opensource Bun backend (under OpenSB) that has an endpoint to compile Luau.
Here's the repo for luau-compile. https://github.com/Open-SB/luau-compile
Although LuauCeption is indeed an option, I intentionally left it out as from my personal experience:
For the most part, barring expected random periods of high latency, implementing a Bun backend to handle this task would be the most performant.
Yeah I don't want to use LuauCeption either, we opted to making a Rust backend instead (was going to use Bun but asked tech if he could make one with Rust instead).
The main reason I wanted to write it in Rust is because using Bun would rely on hacky techniques (bun.$) or hard to write FFI bindings. In Rust however, mlua has already implemented the bindings, which means I just used higher level abstractions and overall benefited from their active maintainers. Please note however that the luau-compile backend may be extended into something larger for data consumption too.
I'll be closing this as we plan to support Luau on locals with Fiu and luau-compile.
Issue
Yueliang is an unoptimized Lua 5.1 compiler, and with newer solutions now available, should not be used.
Solution
Using an HTTP backend, interface with Luau to compile source to bytecode, then run returned results through Fiu for client execution. This can be accomplished two ways: