[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Natural Selection
- From: "Joshua Ritter" <ritterjoshua@...>
- Date: Fri, 9 Feb 2001 14:46:40 -0600
I am posting this for anyone else lurking out there.. debating on which
scripting language to use... *warning a brain dump follows*
I have been "investigating" Python and Lua for almost a year... finally,
some of the deadlines have lightened up, so I am in the process of actually
_doing_ something about all this...
Some reasons we are going with Lua:
We have non-programmers scripting .. Lua is the only choice as far as I am
concerned on this point... and I applaud the language design for it's
power... with lack of complexity... I would say though.. if you have
experienced programmers on a project.. and they are doing the scripting..
they may get to missing some features...
Ease of wrapper classes... I was just reminded about Python's extension
mechanism... a bit of a beast... well.. my classes are automatically exposed
to Lua... I have _one_ callback for functions, _one_ callback for a new
operator, _one_ callback for getting data, and _one_ callback for setting
data ... I used a little trickery here... using c++ callback templates I
generated calling stubs for all possible calling parameter combos (typecasts
from void)... I wrote a program to do this for me of course... all told
about 600k of source :) I had to stop at 2 parameters(3 megs of source for
3 parameters)... _but_ I can add 3 parameter function templates by hand...
not a big deal as there are surprisingly few of those... also keeping in
mind that nonprogrammers can't deal with tons of parameters anyway... being
able to call ANY cpp member function from a void ptr is an INCREDIBLE
feeling of power.. I don't know if I can ever go back to normal coding
practices :)
Wrapper classes continued... Lua helped make this wrapper method possible in
that it is so CONSISTANT.
I have seen benchmarks and Llua is quite fast... I have heard nothing to the
contrary...
I suppose these are the big three.. ease of learning for nonprogrammers and
programmers(hey some stuff you can do with Lua would be a chore in C++),
ease of wrapping for programmers, and execution speed...
And this isn't to mention memory footprints and everything else that goes
into this stuff!
-J