[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: python vs. lua in the wiki
- From: Asko Kauppi <asko.kauppi@...>
- Date: Tue, 22 Feb 2005 19:18:15 +0200
I noticed today that some of the information in Lua wiki's "Lua vs.
Python" page is somewhat outdated. I hope no-one will mind me fixing
them, here's a list of what I intend to do (later today):
now: "this is being resolved in Lua with the new global keyword.
Upvalues were also a little quirky but now there is lexical scoping in
Lua. Python is potentially easier to script for inexperienced
scripters/game designers."
-> "this is being resolved in Lua with the "-w" flag (Lua 5.1, doable
with metamethods also in earlier versions)."
now: "(-) Programs are much more error prone, due to automatic
coercian, accessing of unset variables without an exception, and having
to check most functions for nil values, rather than just catching the
exceptions. There may be some advantages to some of these points
however."
-> "Without the "-w" flag (Lua 5.1), programs are.." (or remove it
altogether?)
now: "(-) LUA handles only one type of numbers, usually C doubles,
which often leads to overwhelming processing. You should look at the
work Python does to add two integers, and think about what overwhelming
processing might mean. (In Python, every integer outside of the range
[-1, 100) is freshly allocated, for example.)
-> "(-) Lua ..., usually C doubles or floats, which can lead to ..."
+ "Lua number type can easily be changed at compile time, even to
'int' or 'long', but having no floating point support might not be
enough."
Addition:
"(-) Lack of binary bitwise operations (or, and, xor..) unless awkward
library functions or other extensions (s.a. patches) are used."