lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Sun, Jan 29, 2012 at 10:52 PM, Laurent FAILLIE <> wrote:
> My 2 cts from a new LUA user/developer ...
>> 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++.

JavaScript in the HTML container might be more popular than C....

> C(++) and LUA are not playing the same GAME. C(++) are fully compiled so
> mostly used when performances is the most important point.

I wish somebody gave me a dollar every time I saw a C or C++
application code go O(n^2) or worse on string manipulation (or other
sequences). Especially easy in C++ since you can treat CString just
like a Visual Basic you get more VB programmers hired to
write app code. Oh, you think MFC4.2 is ancient history? Go read some
embedded code.

There are other inefficiencies people are willing to eat because they
*don't* have a garbage collector (so they make more copies to make
sure theirs doesn't go away), and they do have to strcmp everything
instead of just comparing pointers.[1]

> Secondly, C(++) are very close to the hardware so it's really very "easy" to
> write OSes or drivers or embedded with them.

If you need to use C to do it, it is probably not easy.

> - 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.

An honest question: what did you miss most? I've been inside the Lua
room long enough I just don't know what new users see as missing.

(Note to would-be Lua defenders: it doesn't really matter if the
problem is solved in ten lines of code from the middle of some page on
the lua-users wiki. The feedback we're getting is that if clever
solution X exists, it is not obvious to somebody approaching the

> - It's really difficult to find good tutorials or examples for LUA.

If you have not read it already, ISBN 8590379825. In my opinion, the
best-written "here's my language" book since K&R.[2]


[1]: Somebody is going to tell me "oh but you should be using
outsmart_pointer in boost, and the modern mutable string behavior for
piece-wise append is better than what you'd get in analogous Lua code
from that same VB programmer." Maybe, maybe. I've yet to meet crappy
app code that can outsmart *bullet*. Er, luajit. Whatever. "Cry some
more" sure comes to mind after the code I saw yesterday.

Team Fortress Meet-The-Heavy jokes aside, people really overestimate
how efficient C++ code in the wild is.

> Being interpreted, LUA is not as fast,

"Heh, cry some more." :-)

[2]: _Smalltalk-80:TL&II_ should get an honorable mention. It is a big
book, but it is a big system.