lua-users home
lua-l archive

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


2015-11-05 0:30 GMT+02:00 Stefano <phd.st.p@gmail.com>:

> What I am stating is that the pervasive mentality in the Lua community
> (reinvent the wheel just a bit differently, no backward compatibility,
> no standard functionalities included, no conventions, 300 mini-modules
> promptly abandoned) does not seem to have resulted in a solid
> ecosystem with a good number of high profile packages.

<apology> Maybe I'm hijacking your thread by singling out this remark
for further comment. </apology>

Coming from Python, I also lamented the lack of an ecosystem when
I was new to the game. I made a beautiful `dirk.lua` full of tiny utilities
that I was sure I would require in every project. Like this one:

    local into = function(tbl)  -- receptacle for gsub
       return function(item) append(tbl,item) end
    end

Gradually I discovered that Real Lua Programmers do as you say,
and nowadays I paste those uitilties into every project that actually
needs them. I shamelessly plunder collections like Microlight instead
of requiring the module and make tiny modifications to the routines.
It does not bother me. I think it is easier to read the actual code than
to consult somone else's documentation, if any [1].

> I am not sure to what extent this can be argued against.

It is a consequence of the fact that Lua is so minimalistic, and that
is not going to change.

This is not to say that there is no place for an ecosystem, but what
we need is not batteries, it is appliances. The Lua modules that
I `require` and use unchanged are those that package expertise
(lpeg, ansicolors, socket, mime, mathx, etc). They save me time
and bother. Yet another elegant implementation of a class system,
for example, saves me nothing.

<retraction> Actually I think all the above is quite pertinent to
the basic philosophy of what you are trying to do. </retraction>

[1] Microlight itself is very well documented. I plunder its
documentation method too. :-)