lua-users home
lua-l archive

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


On Dec 31, 2010, at 8:06 AM, Gaspard Bucher wrote:

> I don't really grok why standard libraries are needed. If we want to make it easy for people (my kids for example) to hack and play with Lua, we need an ecosystem, not standard libraries. What I mean is that the "require" line is trivial to fix whereas the tutorials, examples, community and making the Lua programmed Lego robot chase the cat are much bigger issues.
> 
> But maybe I just don't get it....
> 
> G.

My goal with respect to standard libraries, which may not be the same as other people's goals, is to provide a set of standardly available, widely accepted code that answers common "issues". So, for example, if the array API that I outlined earlier were available on a general basis and likely to be present in all but the smallest Lua distributions, then when people complain that #t doesn't work if you have holes, the answer would be: "Use array. It does work." Without that standard piece to turn to, we get mixtures of proposals for changes to Lua and suggestions that people go figure out how to build something like array using tables and metatables.

In this particular instance, I might just campaign for replacing the table namespace with array in the core Lua distribution. It would be very close to the same size and would provide a built-in answer to this problem.

So, maybe the next question on standard libraries is whether there are other issues that come up routinely that could be solved with some targeted code in a standard library or whether the length operator v holes is unique in this regard.

Mark