lua-users home
lua-l archive

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



Good point.

I make the gc at userdata (C) side, and 'destroy' is just a dummy. I know.. there's good and bad sides to this, it may change.

I think in a complicated API there'll always be a way for someone to crash the system, if that is exactly (and only) what they fancy. LuaX currently has not been designed for these users. ;)

Oh, level 1 API _is_ hidden from the application programmer. Of course.. shouldn't it be?

-ak

ps. I think this issue is not so much on protecting from malicuous users, but from our own bugginess. What I hate about GTK+ C coding, is by just a little mistake being able to 'poof' the whole system. And those bugs are sometimes really hard to find.. Lua could certainly be helpful in that.


16.2.2005 kello 08:44, Eero Pajarre kirjoitti:

I see one possible major problem with a simple implemetation of the
level one API. Does it enable crashing the application?

I mean something like:

button = create_button("Hello");
destroy_button(button);
set_label(button,"Don't do this");

Avoiding this can add quite a lot of code to the level 1
implementation, especially if the C level libary isn't
helping.

Of course if the level 1 API is hidden from the application programmer,
and only used in implementing the real, higher level, API then everything is fine.

This occured to me when I considered adding Lua into a plugin
enabled (closed source) CAD application, and I noticed that
making the Lua API crash proof was not going to be trivial.


	Eero