lua-users home
lua-l archive

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



Quoting Sean Conner <sean@conman.org>:

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]).


I had a good look at conman and I like it, but ended up writing my own system
because of specific requirements.  Overall though I think conman has gotten
some things very right that make it a good starting point:
 - keep things in one codebase
 - avoid external libraries
 - thematic modules that can be loaded as their own .so/.dll files which keeps
   memory consumption low
 - unit tests for specific modules
- avoid complex/exotic build systems and use make instead (same as Lua itself)

What my own system added (https://github.com/tobbik/lua-t):
 - tests that over-arch the modules
 - re-use types across the stdlib (eg. a highres timer used in many places)
 - dedicated documentation
 - Anything is wrapped in a .lua module which makes the import easier and more
   straight forward.  It also discourages to implement things on the C-Side
   which are better off written in Lua itself.  If you have written C based
   modules for Lua, you know what I'm talking about
 - not implemented but prepared for writing platform specific implementation
   of functionality
 - use a rigid naming-scheme to easily navigate within the code-base. Slightly
out of base but explained in https://github.com/tobbik/lua-t/blob/master/docs/Coding-C.rst


-tobbik