lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Lua was designed to be an embeddable extension language and it seems
to me that it does the second part pretty good.It's very
simple(allmost everything is implemented with tables) and efficient
and it fits nicely into C.Regarding the first point though,
embedding.I rencently took a look at python(I had to write a plugin
for an application) and after reading the Python to C interface I was
almost ready to switch to python(after reading about the language
itself though I reconsidered).You could define your own data types and
do almost anything.Now I agree that userdata and metatables can
achieve the same functionality and may be more elegant and unified in
the sense of the everything-is-a-table philosofy but why the heck are
there so few metamethods?I mean a few like:
__get,__set,__getindex,__setindex would hepl interfacing lua to C
immensely(just take a look at many of the previous threads).I assume
that the problems is the metamethod look-up overhead in frequent
operations like getting and setting global values but couldn't this be
handled with caching of some sort?Besides __get and __set metamethods
on userdata could help implementing a lot of things without assigning
a metatable to the globals table.
btw why the distinction between full and light userdata in Lua5.Light
ones can be implemented with full ones anyway(using a full userdata of
size sizeof(void *)).I know it's not so important but it seems to me
that it unnecessarily adds complexity when lua's goal seems to be
simplicity.
That's all my bitching for now,
Dimitris