-
Notifications
You must be signed in to change notification settings - Fork 3
FAQ
Luau is an embeddable programming language, this fork rewrites the WASM execution API and actually implements interop allowing you to provide a custom environment for the script that is executed, as well as interop allowing JS to call functions from Lua, and Lua to call functions from JS.
A: 🟩 Q: Can I run this in a website? Yes.
A: 🟩 Q: Can I run this in NodeJS? Yes.
A: 🟩 Q: Can I run this in TypeScript? Yes.
A: 🟩 Q: How does performance compare to native Luau? WASM statistically is around 10% slower due to overhead compared to running the same benchmark on Luau. WASM is still getting 40M+ operations a second on an average laptop, so it isn't that bad.
A: 🟩 Q: Can I catch Lua errors in JS? Yes. You can use try catch statements.
A: 🟩 Q: Can I catch JS errors in Lua? Yes. You can use try catch statements. You can throw a JSFatalError, which can not be handled by the Luau runtime.
A: 🟩 Q: Is it safe to run untrusted Lua/Luau code in here? Yes. Be careful and follow the basic security principles outlined in the security page to be safe.
A: 🟩 Q: How do I load a string as a script? Read the API page and follow the instructions.
A: 🟩 Q: Can Luau call my other npm packages? Yes. You should make a wrapper and make sure it's secure.
A: 🟨 Q: Can I implement my own wait function? Yes. Refer to the Multithreading page for more information.
A: 🟥 Q: Can I run multiple threads? Not really. Refer to the Multithreading page for more information.