> Why isn't Lua more widely used?
> Granted, being a script language, Lua can only hope for a niche
> position, and can never become as popular as C or C++.
C(++) and LUA are not playing the same GAME. C(++) are fully compiled so mostly used when performances is the most important point.
Being interpreted, LUA is not as fast,
Secondly, C(++) are very close to the hardware so it's really very "easy" to write OSes or drivers or embedded with them.
I'm not sure you can address
specific cell of memory (but I'm a beginner in LUA) voiding any low level attempts, and with GC, you totally loose memory management.More, I didn't write large LUA application yet, but if LUA GC is as painful as Java one, real time application is a joke.
Obviously, you can bypass those limitation by writing your own library mixing C and LUA ... but in this case, it should be easier to stay fully in C.
> instance? Could not Lua be used in browsers and do as much a good job
???? Nooooo. All web developers had to fight against brain damaged M$-IE for decade and now, fortunately, it seems things are evolving in the right direction : STANDARDS !
We all don't wan't to fall again in the previous situation, don't we ? When we had to add to standard compliant browser code some glues
for NS4, M$-IE4,5,6,7 (yeah, M$-IE aren't compatibles b/w themselves :( :( ).
Like with m$-silverlight, why bothering to create server-side that will be only usable by a small subset of visitors ???
ensure your web application will run whatever are users choices.
Now, majors problems I found when I started to work with LUA :
- LUA is very easy to understand and start with ... but with strings manipulation. Something that is very easy in C or PHP like token parsing is a tedious task in LUA.
- It's really difficult to find good tutorials or examples for LUA.
- I miss all the powerful libraries I have with PHP.
I started mainly to add plug-ins in Conky (Linux system monitor).
I've been very fast to progress in this language and I thought it has a very big potential, especially because is lightweight compared to PHP : launching small but regular PHP tasks is penalizing as the CLI interpretor is quite large (i.e. for scheduled monitoring tasks).
The second added value is LUA is very flexible : it's very easy and lightweight to add module in LUA, and only when it's needed. And in my case, another interesting
thing is I can have PHP scripts for my big/heavy/complex tasks (indexing, statistics generation, ...) and totally separated LUA small tasks (monitoring).
Then, finally, I like the possibility to use LUA as embedded language for more large application, as I did on the Amiga with AREXX.
As said, I may be wrong on some points as I'm only a LUA beginner ... but it's my beginner feelings'