|
It was thus said that the Great Russell Haley once stated:
>
> Seriously though, Sean has used Lua in production and you you know enough
> to write a reference manual. Someone should start putting design
> requirements in a place for discussion, even if it's just a "thar be
> dragons here" warning to others. :)
So what exactly are you looking for? If you want some designs, you can
always check out https://github.com/spc476/lua-conmanorg (warning:
documentation is spotty) as it contains pretty much what I consider a decent
start towards a good Lua API for various C functions. The ones that get
heavy use by *me* are the ones in C, and I have basically my own versions of
LuaSocket, LuaFileSystem, lposix and luaposix (along with some very niche
modules like TCC [1]).
Over all, most of the modules cover territory that is mostly found in
luaposix (or lposix) but broken out into, for lack of a better term,
thematic modules. I have one for signals, one for select(), one for timers,
one for files and one for processes. This way, I can only include what I
need, instead of pulling in a huge library.
I've used a few third party modules (at work mostly) that I haven't
written, and of the ones I have used, LPeg is the nicest. lua-curl sucks,
but by proxy because libcurl sucks even harder [2]. I'm not sure which XML
module I'm using (LuaRocks lists 8) but I'm not a fan since the project
name, module name and global namespace it sets in Lua 5.1 don't match at
all! [5]
I use GNUMake for the build system. All our systems have it installed and
once I actually sat down and read the manual [6] I haven't had that many
problems with make [7] and given complete dependency information, parallel
builds *fly* by, even on the Solaris boxes [8].
The only "thar be dragons!" warning I can give is---avoid signals. Just
say no to signals. Don't even *think* of using signals. It's (I think) the
worst thing to come out of Unix, hard to use safely, even harder to debug
and should just be avoided.
-spc(Oh, did I mention skip using signals?)
[1] A Lua wrapper for TCC, a C compiler that is also a library.
[2] Not every system I use at work has libcurl installed. So I needed
to include the source to that in the repository. Building that
*ssssuuuuccckkks* and is the cause of half the problems I have in
building [3].
[3] The other half deals with OpenSSL, which I only use for the hash
functions [4].
[4] org.conman.hash
https://github.com/spc476/lua-conmanorg/blob/master/src/ hash.c
[5] This is only used for testing---it's not used in production.
[6] https://www.gnu.org/software/make/manual/
It's one of the better manuals I've read. Seriously, it's all in
there and it's nicely organized.
[7] The only issue so far is with target specific variables. I had:
workprojectbinary : LDLIBS += -lcrypto
which works, but LDLIBS is *also* modified for all prerequisites,
and that included luac (which is included in the build). On one of
our build systems this generated a luac which couldn't be run since
libcrypto was linked into luac, and libcrypto was in a non-standard
runtime location.
That was the *only* issue with make I've had.
[8] Which are freight trains. They're slow to start, slow to stop, but
once they get going, they're not bad speed wise.