[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Expanding the standard library functions?
- From: Hisham <h@...>
- Date: Tue, 26 Jan 2016 00:10:36 -0200
On 25 January 2016 at 06:32, Dirk Laurie <email@example.com> wrote:
> 2016-01-24 20:58 GMT+02:00 <firstname.lastname@example.org>:
>> I was heavily inspired by Ruby's standard library, but tried to avoid
>> adding functions that are just simple aliases. My rule was, if it can't
>> be done in one line of Lua code, write a new function for it.
> The others have all been too polite to say this, but if you took an hour
> or so to browse the list archives and wiki on lua-users.org with search
> terms like "split", "strip", "trim" etc you'll find that:
> 1. Very similar things have been done many times before.
And if it happened many times and keeps happening, it's because
there's a clear need.
I, for one, am really happy to know that the next time I need a
string-split function I'll be able to just type `luarocks install
split` and be done with it without having to "take an hour or so" to
dig through the wiki and read through pedantic minutiae about corner
cases in 8 different versions of string-split. I know _I_ ended up in
that page more than once and always turned away with a shrug! Thank
> 4. Almost every Lua programmer prefers to roll his own, even
> when as in Penlight or Microlight the library is very well organized
> and written by a Lua expert.
There's _a few people_ in this list that keep insisting that "the Lua
way" is to "roll your own", but the fact that Penlight stands as the
8th most downloaded rock with 2771 downloads *this week* says
Just because one person does things a certain way it doesn't mean
"almost every Lua programmer" does it. It's always good to remember
that the vocal minority of frequent Lua list posters does not
represent the entire community (and neither does the LuaRocks
userbase, for that matter — Lua is used in many different ways and not
even the Lua team seems comfortable to make sweeping statements about
the Lua userbase as a whole).
> So posting it somewhere and hoping
> that it will get used is wishful thinking. Trying to persuade the Lua
> team to include it in the next Lua is even harder.
> So my immediate reaction is "nice, nice, now you can go and
> write some real Lua code for some real application". For instance,
> user-friendly interfaces(not just crude bindings) to audiovisual file
> formats, such as Peter Billam has done for MIDI.
My immediate reaction is to welcome Charles to the community, and to
direct him to this post from Roberto about Lua's unusual development
And of course, to let Charles know that new modules adding
capabilities to Lua are always welcome in the LuaRocks repository! :-)
Also: Luiz, I do have some feedback to the Lua team: that link above
was a bit too hard to find (it was buried in the text of an answer
from the FAQ, and I only found it because I knew what I was looking
for). I think it would be really useful to have a page on Lua.org
explaining the project's development model, and my suggestion is to
have it easily accessible via the Community → Contributing section.