function say.greet()
print("Lua rocks!")
end
I love Lua as a language it's fantasticly simple, no word of a lie, you can learn all of Lua in around an hour.
If your here reading this you might already know what Lua is and why it's a bit special with it's relationship to C, it's no wonder Lua is big in the game dev world as the scripting language of choice.
Brazil have the most interest, no surprises being the origin of this wonderful language, actually on the subject, Lua is the only language to gain any traction originating from a less developed country in the world.
In web development, Lua can be used and is a major component of OpenResty, aka Nginx's cousin. And yet it has little importance in web development, there are some who wish that Lua could be a direct competitor to JavaScript.
If your wondering, "but does it web?" yes, yes it does, we can run Lua in the browser through Wasm or in node via my node Wasm project (my hopes to make a multiplayer game with Lua game engines), ironically the Lua will be faster than the JavaScript. but honestly it's a toy project.
If a language is dieing a slow death can it ever hope to recover, what does it take to do that?
Top comments (14)
Neovim has moved to Lua. I find it best suited for plugin ecosystem but I know there are lots of games using Lua as well. I wouldn't tout it as a dying language. Just has more of a niche on where it shines best.
I created LuaConsole to address some pitfalls Lua can have. The packaged CLI is just terrible and functions sporadically when combined with multiple different switches. You can't capture output easily due to copyright messages. My aspiration for the project was to also replace bash and batch in my image. That got as far as relying on exec() to do everything, so I focused on making Lua great with a powerful REPL environment and tons of switches for endless possibilities. Lua isn't dying on my watch!
That gives me hope. A few years back Lua was on a worst languages to learn list for the given year so I sort of just stopped trying to embed it into node.js. I'm resuming my effort for the fun of it
As you should! I love Lua as well. It's just not the hot new thing, but still has plenty of love.
Lua isn't exactly dying, it's just not a general purpose language.
The simple fact is that it fills couple of rather disjoint niche use cases because it has a rather atypical set of major selling points, namely:
Now, it obviously still has some limitations, the big ones being a rather anemic standard library and the fact that a number of the design choices that make it so easy to implement and embed also make doing certain things with it very difficult (lack of true parallelism support in the language itself being one of the biggest examples).
You can see the same kind of thing with a number of other languages, they're very big in specific niche use cases, but almost unheard of outside of those. Forth is an excellent example as a comparison, it's widely used for firmware, but rarely touched for almost anything else.
I've seen it run on PIC and AVR and MSP430 microcontrollers,
I've even seen it run as a raw REPL on hardware older than the language itself.
It was pretty big in the PSP and PSP hombrew scene. Embedded hardware yes!
I created LuaConsole to patch what was missing from our modern day REPLs. It's still expanding!
Lua was never meant to be a general purpose language or an alternative to existing scripting languages. It was designed to be embedded into applications where the complexity and most of the logic are hidden.
Thereβs really not so many contender in that area. Embedding python in an application is such a hassle, and libpython itself is huge. Thereβs AngelScript and ChaiScript which are easy to embed but are specifically for C++ only.
Embedding lua is simpler and the library can easily be linked statically. It doesnβt have dependencies. Itβs really small. And the language is easy enough that a seasoned programmer can start code in it (to extend the functionality of an application) within a day.
Lua and LuaJIT should merge and collab together, without it Lua can be slow,
at least thats my feeling when I was learning it, nothing particular with Lua,
I feel the same for Ruby and Crystal etc, now I feel comfy with Nim.
Lua is really a terrible language. JavaScript is
just far superior.
Every Lua environment is just so different from each other. The ones I've used don't allow for custom exception handling or concurrency. Lua is not used because it's good or the best, it's used because it's easy to embed and it does the job.
You can do Javascript for front-end and Lua for back-end.
Check out OpenResty, Lapis Web Framework and Moonscript.
Your comment was quite negative π, this is an old post for me but I'm hungover and don't care alot to fight about language X is better than Y.
Lua is (a great language which is interesting to me) if rarely used as I do what the rest of the world does, use JavaScript. Lua has a design philosophy which should be understood before you can say it doesn't even come with Z. That's my two cents
I'm fairly new to linux, having been a programmer in clipper5, (dos) for 25 years. First I tried languages that resembled clipper, but they were all dying out. Bash came next, which I'm good at, stumbled around python, rust, then I say a reference to lua. My first 10 minutes, I was just saying WOW.
Lua is the closest I've found to clipper, but then why wouldn't it be, both are written in ansi C. I had customized clipper to be a sudo multi threading system, so working in lua is my choice now. I only found it a few days ago, so I'm still experimenting. So many of the commands and statements are the same, which makes things easier.
I'm going to say that's as long as C Is a functional useful language, lua will exist.
Off the topic, but your google trends analysis is a little off. "Lua" simply means the moon in portuguese; no wonder the word is used most often in Brazil and Portugal. Set your scope to programming language, and you will see Lua the language actually gets the most interest from China.
Yes. Lua is doomed.
Just like every other language.
As the saying goes, "this too shall pass".
This is not a bad thing - evolution carries on.
The useful ideas popularized by lua will be more likely to be picked up in newer languages, and the bad ideas that became trapped in lua will be allowed to die.
Perhaps your question was intended to be, "Is lua worth investing in?" which is a bit more complicated. :)