lua-users home
lua-l archive

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

On Tue, Jul 18, 2000 at 11:32:35PM -0300, Sean Middleditch wrote:
> OK, I have a question: what 'ups' are there to using Python over Lua? 

I love them both, but here is my "benefits of Python" list:

There is a huge system library of Python modules which do useful
things. If you need this, then you really should use Python because
reproducing it in Lua would not be fun. :)

SWIG is a tool for automatically generating bindings from C/C++ code
to scripting languages. It supports Python, and might be more complete
than toLua.

Python has a standard and well understood class machinery, with a
dedicated syntax. It may be easier for others to understand what
you've done and come up to speed. Lua has meta-mechanisms which allow
you to implement any class based system, but nobody will understand
your quasi-syntax, and they certianly won't be able to read an O'Reily
book about Lua or your weird class system. (ex: my game has a weird
traits based multiple-inheritence scheme in Lua)


I prefer the Python language and syntax to lua, mostly because it's
centered around a list-iterator-style for loop, instead of Lua's while
or C-style for(;;). I find Python code very easy to read
(i.e. concise) and very easy to write bug free the first time because
of this. 

In closing, most of my Lua-wish-list features are pulled right out of
 - simultaneous support for integer and floating point types
 - linked-list datatype 
 - next tag-method (so you could truly implement a new type of table
     or list datastructure. Although I assume Lua does not
     have it because it's more complicated than it seems.)
 - Python style "for x in [a, b, c]" loop
 - exceptions

That said, the simplicity, portability, and speed of Lua keeps me
happy using it for embedded scripting. :)

Aside: There is a beautiful programming language which is conceptually
  derived from Python called Ruby. ( )
  The biggest major difference between Ruby and Python (IMO) is that
  Ruby has a unified type system and it uses garbage collection, not
  reference counting.

David Jeske (N9LCA) + +