lua-users home
lua-l archive

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


Hi all

Peter Wang wrote:
 
> Brandon Van Every <vanevery@3dprogrammer.com> wrote:
...
> The two best reasons I can think of for using Lua are: (1) it is
> very fast, which is incredibly important for games (as I'm sure you
> are aware) and (2) it is very small, which may or may not be
> important to you.  It also has a flexible and easy to use API.
> 
> You mention Python, which is interesting because, for me, it fails
> in the above two aspects.  Although I like the language more than
> the Lua language, the implemention is (1) extremely slow (possibly
> due to the nature of the language) and (2) extremely big (most of
> the modules are unnecessary for games).  Python is great as a
> stand-alone language for quick'n'dirty scripts or full-size
> applications, but I wouldn't use it as an extension language.

I've benchmarked the function invocation speed and found that Lua beats
Ghostscript by a factor of 1.5 and Python by a factor of 2.

> If you need more speed, I'd suggest you look around at a few Forth
> or Lisp/Scheme interpreters (e.g. QScheme).  Unfortunately, most
> end-users are used to infix notation, which may limit your choice.

All Schemes/Lisps I know as well as Perl (including Emacs-Lisp which is
reputedly very fast) are behind by a factor of at least 3 to 4. Worst is
Tcl. I haven't checked any Forths, but most Forths don't have the notion
of an object with dynamic (run-time) type description, which Lua as well
as Ghostscript (the most Forth-like of all) has. Instead, you have to
mess around with machine words in Forth and decide whether you want to
interpret that DWORD as an integer, a float, or a pointer.
So I would expect that there is not much around that might beat Lua.

Dolfi