Lua is a free and open-source, highly effective, sturdy, minimal, and embeddable scripting language. It’s extensible and interpreted scripting language that’s dynamically typed, and run by deciphering bytecode with a register-based digital machine.
Lua runs on all if not most Unix-like working programs together with Linux and Home windows; on cellular working programs (Android, iOS, BREW, Symbian, Home windows Cellphone); on embedded microprocessors (ARM and Rabbit); on IBM mainframes, and lots of extra.
See how Lua packages work within the reside demo.
- Builds on all programs with a regular C compiler.
- It’s remarkably light-weight, quick, environment friendly, and transportable.
- It’s simple to be taught and use.
- It has a easy and well-documented API.
- It helps a number of varieties of programming (equivalent to procedural, object-oriented, useful, and data-driven programming in addition to knowledge description).
- Implements object-oriented by way of meta-mechanisms.
- It additionally brings collectively easy procedural syntax with formidable knowledge description constructs rooted round associative arrays and extensible semantics.
- Comes with automated reminiscence administration with incremental rubbish assortment (thus making it excellent for real-world configuration, scripting, and in addition breakneck prototyping).
How one can Set up Lua in Linux
Lua bundle is accessible in official repositories of main Linux distributions, you’ll be able to set up the most recent model utilizing the suitable bundle supervisor in your system.
------- On Debian, Ubuntu & Mint ------- $ sudo apt set up lua5.3 ------- On RHEL, CentOS, Rocky & AlmaLinux ------- # yum set up epel-release # yum set up lua ------- On Fedora Linux ------- # dnf set up lua
Word: The present model of the Lua bundle within the EPEL repository is a little bit older, subsequently to put in the most recent launch, it is advisable construct and set up it from the supply as defined beneath.
Set up Lua from Sources
First, guarantee that you’ve got improvement instruments put in in your system, in any other case, run the command beneath to put in them.
------- On Debian, Ubuntu & Mint ------- $ sudo apt set up build-essential libreadline-dev ------- On RHEL, CentOS, Rocky & AlmaLinux and Fedora ------- # yum groupinstall "Growth Instruments" # yum set up readline readline-devel
Then to construct and set up the most recent launch (model 5.4.4 on the time of this writing) of Lua, it is advisable obtain the lua supply file or run the next instructions to obtain the bundle tarball, extract, construct and set up it.
$ mkdir lua_build $ cd lua_build $ curl -R -O http://www.lua.org/ftp/lua-5.4.4.tar.gz $ tar zxf lua-5.4.4.tar.gz $ cd lua-5.4.4 $ make linux take a look at $ sudo make set up
After getting put in it, run Lua interpretor as proven.
$ lua Lua 5.4.4 Copyright (C) 1994-2022 Lua.org, PUC-Rio >
Utilizing your favourite textual content editor, you’ll be able to create your first Lua program as follows.
$ vi good day.lua
And add the next code to the file.
print("Hiya World") print("That is Tecmint.com and we're testing Lua")
Save and shut the file. Then run your program as proven.
$ lua good day.lua
For extra data and to learn to write Lua packages, go to: https://www.lua.org/dwelling.html
Lua is a flexible programming language being utilized in quite a few industries (from the online to gaming to picture processing and past), and it’s designed with a excessive precedence for embedded programs.
If you happen to encounter any errors throughout set up or just wish to know extra, use the remark kind beneath to ship us your ideas.
If You Admire What We Do Right here On TecMint, You Ought to Think about:
TecMint is the quickest rising and most trusted neighborhood website for any type of Linux Articles, Guides and Books on the net. Tens of millions of individuals go to TecMint! to go looking or browse the hundreds of revealed articles out there FREELY to all.
If you happen to like what you’re studying, please think about shopping for us a espresso ( or 2 ) as a token of appreciation.
We’re grateful to your by no means ending help.