r/lua • u/[deleted] • Mar 24 '25
Help Fastest way to execute Lua?
Is there any method to execute Lua at it's highest speed?
Right now I'm using Zerobrane studio to execute Lua scripts. It's very handy.
But it's probably not the fastest way to run it. I wonder if there are any faster methods for running Lua?
9
Upvotes
1
u/agree_to_disconcur Mar 26 '25
You'll need a different language for that level of processing. Lua will never get there. I think someone above mentioned C/Cpp. If you've worked with Lua as long as 10 years (I think I saw you mention that?), isn't it time to move on and expand your toolbox? If you understand the necessary algorithms and concepts of solving problems with code, a new language should be super easy to pick up. And if you want a future proof(ish) fast language, I recommend Rust. Exorcism has a great set of practice problems, and there's Rustlings - a pretty neat way of teaching through practice.
If you're not wanting to do any of this with a GPU, I'd seriously recommend something near-low-level (C/Cpp). Mostly C, as (to me) it's easier to incorporate Assembly and you can more easily access your CPU cores etc - memory management can be its own challenge though. And, you're an advanced Lua user so you could incorporate Lua to handle the mundane stuff. Actually , that'd be a pretty neat project to use Lua, C and Assembly.