lua-users home
lua-l archive

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


On Wed, Apr 9, 2014 at 5:14 PM, Coroutines <coroutines@gmail.com> wrote:
> On the other hand if it winds up just being used for local
> declarations at the head of files then performance isn't a concern and
> it could be written in pure Lua just fine.

Yep, like the slots/from hack - you really do not need that kind of
magic in a frequently called function!

> mind installing it -- the distribution size doesn't bother me, it's
> keeping what I don't use out of memory that concerns me.  There are
> places where I have to be pretty light on memory -- my NAS mostly.

When I started Penlight, I was a recovering Python programmer, so I
wrote it in a Python style, building new functionality on top of old
functionality.  Then I got the minimalist Lua religion and started to
clean up any non-essential module interdependencies. Many of the
modules in fact only depend on pl.utils.

require 'pl' is a convenience hack - it's all _load on demand_ so only
referenced modules are loaded. Was pretty proud of it at the time but
I don't recommend it for writing modules - all magic has a cost, as
Terry Prachett always emphasized in his fantasy books.