LuauExecutor
GitHub | Download | Documentation
LuauDispatcher
GitHub | Download | Documentation
LuauParser
This entire project was built around this project by the amazing vantoanvh!
GitHub | Download | Documentation
Introduction
For a while now the gold standard for a luau-in-luau type module was vLuau, a Luau VM written entirely in Luau as a replacement for Roblox’s loadstring. However, there are a few issues with it.
- It has MASSIVE. In most of the games I’ve worked on, it’s been about 1/3 of all the lines of code.
- It isn’t very future-proof. If something new gets added to Luau there is no guarantee it gets added to vLuau.
So, when I saw someone had made an AST generator that was fast, small, and easy to learn, I hooked into it.
Over the past 2 weeks I’ve worked on LuauDispatcher on-and-off, which uses an AST made by LuauParser to execute luau code. I already can tell you it is going to be easier to maintain than vLuau. A new library gets added? New key in Dispatcher.globals, push an update, we’re done. Something core about the language changes? Just add another node in the list of supported AST nodes.
Not only is it easier to maintain, but it is generally faster than vLuau, too. Not by too much, only about 10%, and on things like deep recursion and big loops, it falls behind. If you’re interested in the exact benchmarks check the GitHub for LuauDispatcher.
Usage
You can either use LuauDispatcher + LuauParser individually, or use the wrapper I created to make it as easy to use as possible, LuauExecutor.
It is just like the vLuau you already know and love:
local LuauExecutor = require(path.to.LuauExecutor)
LuauExecutor(code, options, ...)
You can read more about the options on the LuauExecutor GitHub.
Issues
If you run into issues, make a github issue or comment here. I will try to help you the best I can, and if you find a bug you’ll be credited in the next release!
Anyway, I know this has been a very brief summary, but I do highly encourage you to check these out, and check out LuauParser by vantoanvh. I did the easy part here.