lua-users home
lua-l archive

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

> I would like to propose a standard lua library. Written in Lua. This library
> should hold a series of well-defined, offen used functions. The purpose of
> the stdlua is to create a common library that will improve the expirence of
> programming in Lua and will help people exchanging source code.
> The library could also be a good starting point for new users trying to
> learn Lua.
> How to include:
> dofile("stdlua.lua")
> stdlua.lua should only expose a single global variable "stdlua" and all
> functions should be members in stdlua.
> Example of function that could be part of stdlua.lua:
> clone()
> could be the place for suggesting, validating and
> maintaining the library. A primary maintainer should be appointed.

I think this is an excellent idea. It would be even better if this
could be part of the distribution, but initially it's a better idea to
"shake down" a first version.

In any case, the time is certainly ripe to start such a library, so
that people such as myself who use Lua mainly for scripting don't have
to keep reinventing the wheel. It's been pointed out several times
that Lua lacks the framework of Perl, Python or Ruby, and Lua could
actually be a very strong contender in the general scripting arena
(without compromising its original design goals) with better library

On the other hand, it's still worth applying the same criteria of
simplicity and minimality to a library as to Lua itself: to my mind,
there's very little point having a Foo::Bar::Baz() routine that does
exactly what you want in a single line if there's an obvious way to do
the same thing in two or three lines with a much smaller and simpler

I have already been delighted time and time again to find
that I can write scripts in Lua that are as short as or nearly as
short as the equivalent in Perl, despite the fact that the base
language and standard libraries are much smaller than Perl and its
standard libraries. Lua's beautifully sugared syntax, powerful tables,
brilliant string matching, first-class functions and extensible
semantics allow a lot of common scripting needs to be expressed
concisely without the sort of random "magic" you get in Perl.

I have a collection of a few tens of routines of my own that I'd be
happy to throw into the mix, as I'm sure many others do.

-- | computation, n.  automated pedantry