Looked a bit at Lua lately, as tinypy doesn’t really seem to carry on (yet) and so is a bit risky to use for anything.
Good points about Lua I’ve seen at first glance:
- Human readable syntax.
- Simple, fast and small virtual machine.
- Secure embedded execution.
- Easy to embed and extend in a C program.
Bad points:
- Syntax is almost too simple – it’s almost 100% identical to a 20 year old BASIC dialect.
- Variables are global instead of local by default – catastrophic design mistake.
- Arrays start with “1″ instead of “0″. Somewhat cumbersome.
The global variables are a kinda big issue, makes it very hard to use scripts in a good way if you have many of them. But of course nothing stops you from sticking a “local” before every use of a variable – which would negates the “human readable” part in the good points though. Oh well.
Update
I figured out a rather easy way around the global variables problem. The answer is lua_setfenv. Basically it means in C code I set a new environment for each Lua module. Then the Lua code can use global variables but they are only global to this module. Variables in other modules can be accessed simply by preceding them with the module object. So, this is quite nice.
![[a]](/pics/allefant.gif)
20000
ABPS
Allefant1
Allefant2
Allefant3
Allefant4
Allefant5
Allefant7
Battery
BlitzHack
BloboTron
Bob'n'Rob
Command Code
Donkey
Doomed
Dragonfly
EggHack
Evil
Feud
FruitWorm
Garbage
GnomeGuard
Hare
Hydra
Insanity
JetFighters
Lawn
Magnetotron
MarsFight
Nefertem
Owl
Photon
PI
PumpkinForest
Red, White & You
SIC
SoF
Squiddle
Swarm
TheWave
Tom
Troll
Ultimatum
Velocity
X
xmas
Zombie Master
HexMap
IsometricProjection
VSync