lua-users home
lua-l archive

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


Ignazio Di Napoli <neclepsio <at> gmail.com> writes:
> I'd like to use a Lua program to script an application using JScript.
> I'd like to do in JScript something like:
> Lua = new ActiveXObject("Lua.Lua");
> res = Lua.DoString("return 'Ciao'");

General background material (not specifically pertaining to JavaScript) is in
http://lua-users.org/wiki/UsingLuaWithOtherLanguages .

The recommended approach would depend on your requirements (e.g. security,
platform, performance, and simplicity), but there are .NET and COM interfaces
you might go through.  If the Lua code can be run out-of-process, the simple
command-line/pipe interface, as in (lua -e 'print [[print "hello"]]' | lua - ),
or CGI/HTTP/XML-RPC/sockets may work nicely.  If the JavaScript has access to a
Java applet, some of the Java approaches could be used, and there even have been
some discussions of running Lua bytecodes natively on the Java or Tamarin VM's,
but that could be much more complicated if an existing implementation does not
exist.