[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua plugin manager library
- From: Hadriel Kaplan <HKaplan@...>
- Date: Sat, 16 Feb 2013 04:59:16 +0000
On Feb 15, 2013, at 7:55 PM, Hisham <email@example.com> wrote:
>> 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
>> 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.
> 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?
Yeah I know it's weird to say that, but for at least my company a lot of it has to do with practical/pragmatic reasons, not technical. We've got ~200 developers, mostly all C/C++, but only a fraction that really know Lua and it's binding into our systems. So even practical things like having enough people around all the time to fix things is trickier if it's not in the "common" language of the systems. Then there's things like logging, snmp traps, alarms, etc. for when things go wrong in the plugin retrieval process. Those are available as simple calls in C/C++, but not yet exposed into Lua (some are, not all). Likewise interfacing to a GUI (or in our case a web interface and a text-based command line) is available easily to C++ code but not yet fully exposed into Lua. And lastly is LuaSockets, which we cannot currently use as we still have to support VxWorks on many systems. All those things will eventually be available to Lua in the future, but it takes a long time.
On the Wireshark side obviously I'm just making assumptions - it's a large group of contributors and I have not asked them about using LuaRocks to do this - but I'm guessing it would be some of the same issues. Wireshark supports Lua plugins to perform some things, for example protocol dissection/parsing for protocols not natively supported in Wireshark. It would be the type of thing to have a Lua plugin manager for. But most of Wireshark is written in C with GTK for GUI, and lately some C++ for a new Qt GUI, and most of its core contributors are fluent in C but not Lua. Even the binding generator scripts for their Lua API are written in Perl and not Lua (which I find quite ironic, btw). So to use a Lua-based plugin manager would be problematic I think because any bugs/issues with it would be hard for them to fix quickly, as they'd be dealing with a language model many of them don't understand well. They also don't have much GUI-side support for Lua, and no LuaSockets. But having said all that, I'm quickly convincing myself I like the idea of using LuaRocks for it, so maybe I'll try to do it in time for SharkFest.