On Dec 1, 3:12=A0pm, Jeremy Hinegardner <jer... / hinegardner.org> wrote:
> On Tue, Dec 02, 2008 at 04:26:39AM +0900, Avdi Grimm wrote:
> > On Mon, Dec 1, 2008 at 12:12 PM, Jeremy Hinegardner
> > <jer... / hinegardner.org> wrote:
>
> > > Crate is a tool to help package up your application as a custom stati=
c
> > > build of the ruby interpreter plus all dependant binary extensions.
> > > All the pure ruby code (the ruby application, the ruby stdlib, etc) i=
s
> > > packed into one or more SQLite databases.
>
> > Stupid question: what's the advantage of using a SQLite DB over a
> > tarball or zip file?
>
> Stupid answer: I really have no idea. =A0I didn't even think about it.
>
> One of the requirements I set for myself on this one was that there
> would be no 'unpacking' of the ruby source code onto the deployed file
> system. =A0 That, and I just like the idea of requiring ruby code that is
> really a row in an sqlite database :-).
>
> You could overwrite require to open up an archive file of some format
> and load the ruby file, and I see no reason why someone shouldn't write
> that. =A0Rubyscript2exe takes this appraoch, and unpacks the .rb files to
> the file system.
>
> Off the top of my head, the main advantage I see of using sqlite over
> zip/tar file is your application gets the free bonus of having a built
> in relation database with no extra cost.
>
> There may be some performance advantage for require in that it only has
> to do a select from a db, vs open up .zip file for ever require, but I
> won't consider that a valid argument at this point. =A0
>

Sorry to bring this, but Python packages the standard library and your
application into zip files.

It maps the File requests that deal with files to the zip file, which
the handler is open once and keep opened until the application ends.

There is one problem with this which is search for the proper
requirement, which I guess having a sqlite engine backing up will make
it easy.

I'll need to check it out how it works with gems that depends on
extensions, since dlopen / LoadLibrary needs a real file and cannot
map a memory address to load the symbols (just thinking out loud here,
maybe you already figured this out).

> enjoy,
>

BTW: great release!

Regards,
--
Luis Lavena