lua-users home
lua-l archive

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

Hello! I've been reading and learning about Lua for a bit and have a
question:  When is it appropriate to embed Lua, instead of extending it?
 I ask because for most scripting languages (Perl/python/ruby), the only
real option is to extend the language, by writing a binding to the
target library through the language's FFI (foreign function
interface)... so the entire concept of embedding a language is foreign
to me. 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. I *think* I am missing something cool here, but I
can't really put my finger on it... can anyone give me an example where
embedding Lua was a better option than extending it?