DEV Community

JavaCode7
JavaCode7

Posted on

My opinion on Lua

Lua is my fifth favourite programming language and for good reason. I like its speed, its syntax and the fact that it is so simple. Lua is written in C and can be used for gamedev, webdev and sometimes even appdev.

My first time using lua was in my thulium esolang. I used it in the lexer and found it nice and I was able to use it to do what I needed with minimal setup.

I didn't touch lua again until I made chromium about a month later. I copied a lot of the code from thulium and in the end I got it done.

I would say that lua is a language good for beginners but not the best for framework programming (excluding gamedev). The syntax is at least somewhat intuitive and thanks to its small size it is quite fast. It is also good in scripting.

I like it mostly because of its applications in scripting (because I am not a framework dev) but its main weakness is the fact that it is... well... weak. It doesn't have much functionality in the world of webdev and appdevs usually favour languages like JS and Python as opposed to Lua.

Top comments (6)

Collapse
 
freakcdev297 profile image
FreakCdev

Lua is actually very strong and technically much more suitable for embedded programming since it's fairly light and runs through a VM.

Over all, nice article!

Collapse
 
sainig profile image
Gaurav Saini

I tried Lua and Love for a hobby game once which, like many side projects, got abandoned (big bummer). But I have to admit, the overall experience was very nice

Collapse
 
javacode7 profile image
JavaCode7

Happy to hear that! What framework did you use to make the game?

Collapse
 
sainig profile image
Gaurav Saini

It was Love - love2d.org/

Thread Thread
 
javacode7 profile image
JavaCode7

I have heard of it. It is probably the most famous gamedev framework for lua.

Collapse
 
xtofl profile image
xtofl

In the embedded world, Lua is quite popular for its tiny VM footprint (120kB or so).

We had a middleware programmed in C and a number of home gateway applications implemented in Lua on top of it.

There is no such thing as a 'weak' language: the power of Lua is in its simple grammar, its straightforward and explicit error handling mechanism, support for functions as first class citizens (a novelty in the C world!), coroutine support...

Indeed, use it for these strengths.