lua-users home
lua-l archive

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

Roberto Ierusalimschy wrote:
> > It's never a good idea to export an internal structure. Especially
> > not, if it's allocated externally. You cannot add an element or
> > increase the struct size without breaking the ABI.
> Usually new Lua versions break the ABI in several other ways, so
> that does not seem a big problem.

So when you want to change the internal implementation, you may
need to break the ABI. Or you can't change the implementation.
Either case is bad.

ABI breakage, especially if it can be avoided, is not a virtue.

> > You already made that mistake with lua_Debug, please don't make it
> > again.
> What was (is) the problem with lua_Debug?

The struct is allocated outside the core VM. So it has a fixed
size and there's only one element for use as a context by the
core. There's no provision for extensibility (like padding).
That's seriously limiting the implementation choices for the core.

[You can look into the sources of LuaJIT what strange kind of
workarounds were needed to fit the context into 'int i_ci'.]