Hi bros ! Today, we will print ‘Hi bro, watsup ?’ in the coolest scripting language ever, Lua.
Firstly, we have to install Lua.
We’ll easily install lua
with yay
on Arch btw:
|
|
You can install
luajit
if you want even more speed.
After that, open vim, nvim or really any other text editor and start cooking:
|
|
|
|
Finallly, run your code with the Lua interpeter:
|
|
Thank you for your time !
Extra
To see if LuaJit is really faster, let’s compare the time it takes to run the script with Lua and LuaJit.
The following table shows the output of the time
command when running the script with Lua and LuaJit.
Lua | LuaJit | |
---|---|---|
execution time | 0.00s user 0.00s system 5% cpu 0.110 total | 0.00s user 0.00s system 5% cpu 0.076 total |
As we can see, the script is run way faster with LuaJit.