i propose to do it in 3 levels:
- first level libs are simple bindings around OS calls (i.e. using
pointers and C structures)
- second level works on top of first level and provides the same
functionality in Lua way
- third level are OS-independent libs working on top of second level
I second that. Level 1 libs would focus on coverage (thinnest
wrapper), layer 2 still on coverage, but would encapsulate the
primitive structures into tables and such for convenience, still no
functionality would be swallowed in the process, and then, the level 3
would be the "abstraction fest" level, where you can have whatever
goals: either portability, OOP encapsulation, stream abstractions,
fluent-style APIs, whatnot.