lua-users home
lua-l archive

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

David Jeske wrote:

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

Not really something I need... In fact, I'd want to limit access to all
this (no big deal, you can easily do with Python as I understand).  All
the functions needed, besides stuff like basic string handling (which will
be incorporated into the string class in Python 2.0, soon to be released),
will be those generated for interaction with my game.  File saving/IO will
be handled in a special way (to save info for each saved game, etc.).

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

SWIG has no Lua support?  Would this be possible to add?

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

Agreed there.

> Exceptions!

I didn't know Lua was missing those...

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

Personally, the Python syntax is very clean and easy, but can be somewhat
a pain to embed in other document (because of the tab issue).  Lua doesn't
seem to have that problem.

> In closing, most of my Lua-wish-list features are pulled right out of
> Python:
>  - 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.

OK, I'll look into it!

I'm still torn between Lua and Python (if a size limitation is placed on
me, as it may be soon, I know which to go with, at least: Lua).

Sean Middleditch

> --
> David Jeske (N9LCA) + +