I think binary and source rocks have normally been thought of as a way
to distribute packages for installation.  However, we can probably
also think of them as packages of modules that can be loaded at
runtime without necessarily permanently installing them.  This is like
Java jar [1] or Perl par [2] files.  I suggest reading the tutorial on
Perl par's for background [2] on use cases.  In Lua, usage might
ideally be expressed like this:

  lua -lrock=md5-1.1.1-1.win32-x86.rock -e 'local md5 = require "md5";
print(md5.sumhexa("123")) '

(I'm assuming the lua "-l" option is extended to support arguments,
like the "-j" option in LuaJit [3], but there other ways in Lua 5.1 if
this is not available.)

One of the challenges is if the rock contains shared libraries like
DLLs.  Perl par just extracts them to a temporary directory, although
there may be ways of loading shared libraries into RAM without any
temporary files [4].  If the rock contains C sourses, LuaRocks
automatically could fire up the compiler (which it knows how to do),
compile the sources into a temporary directory, add the temporary
paths to package.path/package.cpath, and cache that directory for
future invocations of the program (like [5]).

Some of the links on the bottom of [6], such as LOOP
precompiler/preloader, squish, and strlua are related territory but
not the same as this proposal.

[1] http://en.wikipedia.org/wiki/JAR_(file_format)
[2] http://search.cpan.org/~smueller/PAR/lib/PAR.pm
[3] http://luajit.org/running.html
[4] http://lua-users.org/lists/lua-l/2008-12/msg00120.html
[5] http://lua-users.org/wiki/InlineCee
[6] http://lua-users.org/wiki/BinToCee

------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to