Some time back i saw the mention of Io language available on
iolanguage.com, and i compared it for a short time.
Though io compiles in cygwin on windows, but it does NOT compiles
on mingw+msys. Whereas lua compiles on mingw+msys( Though i am not
able to compile lua with some features,such as dynamic loading etc.
turned on on the mingw). So lua is compilable with gnu compilers to
produce native exe on windows,whereas io is not. So it makes sense
for me to stick with lua.
But i will like to say, that many libraries available for io, such
as curses,regex,xml etc. should also be available in lua some day.
And socket,sql libraries of lua4.x should be ported to lua5 as soon
as possible. There SHOULD BE AN OFFICIAL and MATURE WAY OF
interaction of lua with c++, rather than everyone taking out his own
library for a repititive and unaviodable task of interaction of C++
methods with lua.These learnings from other scripting languages
apart from introspection will take lua to another milestone.
ONE MORE QUESTION APART FROM ABOVE TOPIC: i want to do fltk gui
program scripting in lua (and as fltk and lua both compile on mingw,
linux and cygwin all) in some portable way on mingw,linux and
cygwin. Is there some fltk binding for lua 5 available, so that i
can capture events in and out lua 5 acripts and fltk.
Ashish Ranjan wrote:
> There SHOULD BE AN OFFICIAL and MATURE WAY OF
> interaction of lua with c++, rather than everyone taking out his own
> library for a repititive and unaviodable task of interaction of C++
> methods with lua.These learnings from other scripting languages
> apart from introspection will take lua to another milestone.
There is an official and mature way: the Lua API. I couldn't be happier
with it. It lets me do things exactly the way I choose in an elegant,
consistent and easy way. Maybe you should try it once.
Wim Couwenberg wrote:
> There is an official and mature way: the Lua API. I couldn't be happier
> with it. It lets me do things exactly the way I choose in an elegant,
> consistent and easy way. Maybe you should try it once.
Lua binding interface is a very low level API. I haven't used Io's bindings,
but I've heard that they are very easy to use. Io is a language made by a
single person and with a small comunity, and I belive that it has more
external libraries available than Lua. Maybe Steve can clarify this better
BTW, I think that Lua API should keep as is. Higher level mechanisms can and
have been implemented on top of it. My only concern is that the API should
stay stable, so that higher level APIs don't have to be rewritten. I think
that the Lua authors don't plan any major API change after this release, so
situation will probably improve in the near future.
static int toluaI_gl_glVertex3d00(lua_State* tolua_S)
GLdouble x = ((GLdouble) tolua_getnumber(tolua_S,1,0));
GLdouble y = ((GLdouble) tolua_getnumber(tolua_S,2,0));
GLdouble z = ((GLdouble) tolua_getnumber(tolua_S,3,0));
tolua_error(tolua_S,"#ferror in function 'glVertex3d'.");
Very similar. The big difference is that Io's bindings are OO - that
is, the glVertex3d() function is a method on an OpenGL object which
internally holds any related state. In Lua, you add functions to Lua
and custom userdata to hold any state associated with a binding which
needs to be passed in with each call. (this example doesn't show that
though as GL has static variables to hold it's state) Also, with Io
bindings there's no stack that needs to be maintained. Arguments you
don't use are ignored and the return argument is passed back in the