Just a little note about H3x… Lately I’ve found a few issues with H3x the biggest being that certain functions are not behaving as expected with yields. This is due to my method for creating “wrapped” functions. Unfortunately whenever any wrapped functions are called they can’t yield the calling thread and often times their own threads are left permanently yielding (which can cause memory leaks). This occurs due to my usage of
coroutine.wrap to create “visually C functions”
So basically, 95% of your code will work, but yielding in certain (at least fairly uncommon) situations will probably lead to some hard to diagnose bugs/discrepancies between vanilla luau and H3x.
The advantage of H3x over something like vLua is simply most implementations do not support a lot of luau features (none of the syntax will be supported until someone goes in and updates one of these implementations), whereas the advantage of a “lua in lua” implementation is that you not only get control over what your code accesses, you get full, complete control over everything from locals to upvalues to operators. You can add in your own custom operators, change functionality of yields, etc. (Most of these are actually just straight ports from lua’s C source code directly to lua)