DEV Community

Discussion on: Is Lua Doomed?

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

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:

  • It's remarkably small and fast for what it is (yes, I'm talking about the reference implementation, not LuaJIT). This is a large part of why it's so popular as an embedded scripting language, it has almost no overhead. This is also why it's used in some of the less well known places it's found, such as the init process for some implementations of L4
  • It's written in ANSI C. That is, it's written in a version of C that's 31 years old now. This is huge because combined with how low the overhead is it means you can run it on damn near anything. I've seen it run on PIC and AVR and MSP430 microcontrollers, I've seen people put it on LEGO Mindstorms NXT control bricks, I've seen people run it on old Garmin handheld GPS units, I've even seen it run as a raw REPL on hardware older than the language itself. Quite simply, if you can develop software for a particular piece of hardware, chances are you can run Lua on it.
  • It's very easy to learn while still being relatively powerful. This is big for a lot of applications where it's used for embedded scripting for a number of reasons, and also makes it attractive for hobbyists and other people who don't program as a career.

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.

Collapse
 
tilkinsc profile image
Cody Tilkins

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!