lua-users home
lua-l archive

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


lua-bounces@bazar2.conectiva.com.br wrote:
> The ability to register module loaders, enabling a user to load lua
> scripts from specific locations or even compressed files (along with
> many other uses).  
>
> ...
> 
> This would allow a developer to distribute a program and provide a
> module loader to read the lua scripts from a specific location (such
> as a compressed file or even proprietary file format), without
> changing the lua core.   
> 
I didn't look at the package system proposal, but anything built in
Lua's core that will try to search for modules in some pre-defined or
user-defined paths in the file system upon a call to load, package,
require or anything else seems a bad thing for me, even if I could
disable this feature overrinding the function used to load modules with
a dummy function because the code to do it would still be there, using
memory (I know that page swapping exists in all modern operating
systems) or just sectors of my hard disk.

I'm not against a package system for Lua, but I think that it should be
an add-on to Lua, completely separate from the core. If it isn't I'd
like to ask for that to change, unless it can be disabled at
compile-time. My apps that use Lua are always statically linked (no need
to load .dll's or .so's), Lua scripts are loaded from compressed files
or from compressed chunks of memory and I'm very happy with it *not*
having any package system that would be useless to me.

That said, I completely agree with Tiago's sugestion, a package system
must allow us programmers to decide, for a particular application, where
the modules (if it uses modules at all) are going to be loaded. If I
ever have to write an extensible app with Lua, I'd like to have complete
control of where the modules reside. I don't even like the idea of
having default loaders, unless they can be disabled at compile-time.

Andre de Leiradella