|
Date: Sun, 12 Mar 2017 07:48:34 +0000
Subject: Re: "Private" C modules loaded by Rosie module
Hi Jamie,
loved your talk at last years Lua workshop!On 10 Mar 2017, at 15:23, Jamie Jennings <jj27700@gmail.com> wrote:My question is: Am I asking for trouble by taking this approach?
Why would you hide those modules?
It is a matter of opinion, but I think I’d rather have created a custom loader, as it (from a Lua perspective) adds less magic. See https://www.lua.org/manual/5.1/manual.html#pdf- package.loaders
Also: you’re setting a variable `ROSIE_HOME`, in your initial module you could use the output of `debug.getinfo(1)` to dynamically determine where it is located.
This relates much to the “why” question above. If you’re targeting regular Lua users with this, then I wouldn’t worry to much about the dependency hell.
If the intend is packaging in some user application and have Rosie work its magic behind the scenes, then I’d probably use some protection like your hiding of the underlying modules.
As in that case a user wouldn’t have a clue probably as to what was wrong when getting an error.