lua-users home
lua-l archive

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


> I often heard "Extending and Embedding" about Lua. But what's the
> exact difinitions about them?

An application embeds Lua when it calls lua_open, that is, when it
creates a new Lua state. The Lua interpreter is the most familiar
case of this.

A library or host application extends Lua when it registers
functions (by means of lua_pushcclosure, lua_pushcfunction and
friends) to be called from Lua.

An embedding application often extends Lua as well, and an
extension library can embed Lua by opening new Lua states.

See http://twistedmatrix.com/users/glyph/rant/extendit.html for a
discussion of embedding and extending; it is written about Python
but applies to Lua as well.

-- 
Kurt Jung