[q2x] OT: Lua questions

Brian Hook hook_l at pyrogon.com
Fri Jan 30 03:26:16 EST 2004


> It's true Lua could have a few more warnings here and there. Its
> pretty good though.

Things I would really like:

1.  The ability to limit VM cycles and force preemption.

2.  At the very least, a compiler flag to warn on assignment to 
uninitialized variables.

3.  A real regex library.  They complain that a POSIX regex 
implementation would take up 4000 lines of code, but at least making 
it optional would have been nice given all the other optional cruft 
they provide.

> It's an unfortunate side effect of dynamic languages, but does mean
> you can do more with the objects at runtime and I find productivity
> much higher using dynamic languages, because you have to write less
> code and its more intuitive to write. 

But you can have both.  Cf. Objective-C, which I still consider the 
finest programming language ever created.  I'd be using it if the 
whole world was running OS X (or NextStep).

Obj-C is fully dynamically typed.  You can send any random message to 
any random object with no problem.  But at the same time, if you do 
provide type information, then it will generate the appropriate 
warning.

> with Python. I still think Lua has a little way to go with certain
> features until it becomes a more mature scripting language.

I appreciate Lua for what it is.  They're trying very hard to keep it 
small and not let it become the be-all end-all language that Python 
and Ruby and other strive for.  They just want something that works 
"Well enough".

So things that we take for granted in other languages, such as 
inheritance or lists or stacks or regex, aren't a part of Lua, and I 
think this is one of the reasons for Lua's success.

Roberto's book, by the way, is pretty good.  Short on examples, but 
otherwise quite good.

> leap from static programming to dynamic programming is as great as
> the one from functional programming to OO. 

Um, not quite, but I understand your point =)

> to read code and spot bugs more readily. Unit testing is very easy
> in modular dynamic languages and this may help you too.

Unit tests are fine, except a lot of the stuff I'm testing can't be 
put into units because they're dependent on my kernel running (if that 
makes sense).  If it was a pure Lua program, that's fine, but since 
it's all embedded, everything is a freakin mess.

Brian






More information about the q2x mailing list