lua-users home
lua-l archive

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




On Mon, Mar 12, 2018 at 3:36 PM, Sean Conner <sean@conman.org> wrote:
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.


I was merely imply that you and Dirk seem to have strong opinions on how to develop a standard Lua library and arguably have the credentials to do so. I think your post supports that thought. I, however, do not want to start a standard library any more than the next person. I'm already using or reviewing the three models I think are worthwhile:

Lua + Penlight
Lua + LuaRocks (to be augmented on Windows)
LuaPlus (To be tested)

The joke is done so I'll close StdLuaLib. :)

Russ