lua-users home
lua-l archive

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

On Fri, Feb 15, 2013 at 9:53 PM, Hadriel Kaplan <>
> Thanks for the info Hisham!
> Correct me if I'm wrong, but last time I checked LuaRocks did most of its
> work inside Lua itself, and to grab the rockspec/modules used LuaSockets,
> right?  I.e., it's essentially a Lua app/modules.

Yes, you're right. It is pure Lua. For features not provided by stock
Lua, it can either launch external programs (e.g. wget) or use
additional modules such as LuaSocket, depending on what's
available/configured. All those modules (luasocket, lfs, md5, luazip)
are portable (Windows, Unix) and could even be statically linked into
the host application for simplified deployment.

> That makes a lot of sense for LuaRocks as a stand-alone app, and certainly
> makes sense for embedding LuaRocks inside a Lua-based application.  But for
> embedding in a large C/C++ application, that only happens to use Lua for
> high-level plugins, I'm not sure it's the right approach for a bunch of
> reasons.

Interesting -- what would those reasons be? If I'm following
correctly, you would be more comfortable dealing with a plugin
management and deployment tool of Lua modules that was written in
C/C++ instead? That would be somewhat equivalent to rewrite a good
deal of LuaRocks in C (repository management, dependency matching,
portability concerns, etc.) which sounds like a lot of work...

>  At least not for the apps in my day job, nor for Wireshark (which
> is where this question arose from).  It is intriguing though… I'll have to
> think about it some more.

It is intriguing indeed. :) Many large C/C++ apps make use of pure-Lua
modules, or even have significant parts written in Lua. Since you
support Lua plugins you already have the dependency around, and if Lua
plugins are an optional feature then the Lua-based plugin management
can go away with it when Lua plugins are disabled. At first
impression, it does sound like a good fit to me, but I may be missing
something. I'm very interested in hearing about your concerns, since
I've been thinking about the embeddability of LuaRocks lately.

-- Hisham