[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: tolua survey
- From: Ignacio Castaño <castanyo@...>
- Date: Sun, 1 Dec 2002 05:32:35 +0100
Some people mentioned that they would like that tolua accepted any valid
header file as an input, while many other said that they were not using
tolua, because they preferred their handtuned bindings.
I'm not really interested in full C/C++ compliance. Lua is very different
from C++, and you don't usually want to translate class interfaces directly,
but to change them in order to fit better in the lua programming style. For
example, while in C++ you have a protected variable with two methods to
access it (accessor/mutator) in lua you would like to access the name of the
var directly and let the binding code map the reads to the accessor and the
writes to the mutator.
Another example is the use of prefixes, many libraries have a prefix for all
of its functions and classes (SDL_, wx, etc). In lua you may probably put
them in a module, but doing this in tolua would result in redundant function
While you can rename the functions, you cannot do so with classes (why?),
and doing it manually is sometimes a long task.
Those little things is what keeps me away from lua. toLua should be more
flexible, and instead of just translating C++ to lua, it should allow you to
say: "this is what I want in lua, and this is what I have in C++, now
generate the binding code". But maybe that's just not possible and I'm just
Nueva versión: Webcam, voz, y mucho más ¡Gratis!
Descárgalo ya desde http://messenger.yahoo.es