lua-users home
lua-l archive

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


This is also discussed in an abstract way in the PiL book.  Chapter 24
starts with a description of this from the developers' point of view.  The
first 3 or 4 paragraphs should do the trick.

Rich

> > 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.