[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: some random thoughts on naming conventions for Lua libraries/modules
- From: Sean Conner <sean@...>
- Date: Mon, 13 Jun 2016 05:13:19 -0400
It was thus said that the Great Pierre Chapuis once stated:
> Finally, I am starting to like the practice of module
> namespacing by organization, i.e. "mycompany.util.stack".
> However when doing this I am unsure how to package those
> modules as rocks. Make a single "mycompany" rock?
> Make "mycompany-util"? Make "mycompany-util-stack"?
> For close source, pure Lua modules I am shifting towards
> the second solution, but still allow users to just require
> a part of it (i.e. the Penlight model minus the global
> namespace pollution when requiring "pl"). For Open
> Source the third one appears to make more sense, but
> I am wondering if the trade-off in usability from the
> second one would not make sense as well ("mycompany"
> could be anything else, like "org.conman" here).
As the creator of "org.conman", my case is slightly different in that each
module is pretty independent of the others (a few exceptions, like
"org.conman.string" requires "org.conman.strcore" and "org.conman.cc"
requires "org.conman.tcc" ). As such, I have created separate rockspec
files for each module (only a few are published on luarocks.org) as it makes
sense for these modules. As for names:
-spc (But no "org.conman" or "org.conman.parsers" oddly enough ... )
 A TCC (a C-compiler as library) wrapper. I would not recoomend this
at all, as TCC is, unfortunately, pretty rough around the edges.