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()
> > 
> > www.lua-users.org 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
> support.
> 
> 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
> library.
> 
> 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.

Excellent idea, I suppose a lot of people already have a toolbox of small
Lua snippets and utilities.
You should propose a base file, so we can start to throw in functions
respecting your specification.
I propose to start by putting, among other things, some routines from the
test folder (savevar is a good candidate), and lot of code from Roberto's book
(the DumpString, as I sent to the list, seems appropriate).

For the "obvious" code, taking only 2 or 3 lines, like the test/qp.lua
(convert quoted-printable encoded string), it should be put in a kind of FAQ or
snippet repository. The wiki is of course a good place for this.

PS.: [OT] I remember somebody posted an incorrect link to the bzip2 page
here. The correct one is: http://sources.redhat.com/bzip2/index.html
Easy to find with some searching, but easier if explicitely given :-)

Regards.

-- 
--._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`--

Sent through GMX FreeMail - http://www.gmx.net