lua-users home
lua-l archive

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

Whilst agreeing with that Luiz says in message I would like
to add some additional considerations that have come with using Lua
over a number of years, namely;

The Luiz proposal which I will call osex for brevity, is specifying
an interface that one would expect most OS to implement. e.g
directory functions and iterators. However, Steve make a good point
that there are functions like fork and windows registry functions
that many OS have no equivalent funtion. IMO the simple way out of
this is to avoid putting such functions in an osex library.
Establishing a standard osex for some basic *common* OS functions
is much more important than having a library that is a perfect
implementation of a specification.

Taking this approach makes osex a lot easier to implement and
allows developers to add OS specific functionality as needed. For
example, require "win", "posix", "rtos" etc. To use Steves example,
registry functions would be in a "win" library and "fork" in "posix".

It would seem that other peoples experience mirrors my own, where
someone authors a library for an OS and a subsequent user authors
another library for the same OS etc. This happens because of either
minor bugs or deficiencies in the original. Some standardization
from the Lua authors would stop the waste of brainpower.

I suggest that the Lua authors start by providing a library (the
code already exists) for an osex library that contains a minimal
list of posix and windows common functions. Publish this as a
release candidate and go thru the usual process of inviting input
from the Lua community. This would hopefully get the first standard
osex Lua library implemented. Additional OS support can evolve from there...