From: Luis Lavena Date: 2008-12-02T11:04:32+09:00 Subject: Re: crate 0.1.1 Released On Dec 1, 3:12 pm, Jeremy Hinegardner 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 > > wrote: > > > > Crate is a tool to help package up your application as a custom static > > > build of the ruby interpreter plus all dependant binary extensions. > > > All the pure ruby code (the ruby application, the ruby stdlib, etc) is > > > 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.  I 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.   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.  Rubyscript2exe 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.   > 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