Compiles Luau source code to bytecode.
The returned bytecode blob can be passed to load or cached for later use. If the source has syntax errors the bytecode will contain an encoded error that load will surface.
local bytecode = vm.compile(source, { optimizationLevel = 2 })
local fn = vm.load(bytecode, "=cached")
fn()