lua-users home
lua-l archive

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


<darrenjones@warpmail.net> wrote:
> When is it appropriate to embed Lua, instead of extending it?

You pretty much always do both. You can think of Lua has a scripting language library, and lua.exe as a reference host application which embeds it.

> The way I see it, it makes more sense for the higher-level language Lua to be
> the 'host' language from which you make calls to foreign libs, than to have
> the lower-level language (C) be the 'host' and embedding Lua.

Should Unix be written in shell script? Should Firefox be written in _javascript_? What if your host application is scriptable in 5 different languages -- does it make sense to think of any one of them as the host?

Imagine you're the author of a big application like, say, Photoshop, and you want to expose some a macro functionality. You embed Lua (so you can run Lua scripts) then extend it (so those scripts have access to selected parts of your app's internals).

Cheers,
Eric