Announcing Zliby — All Zlib, Pure Ruby

A few weeks ago Dr. Wayne Kelly posted on the IronRuby mailing list the set of libraries and methods that had to be implemented in order to perform a rubygems setup.  This is an important first step towards full rails support.  I volunteered to take on the task of porting the Zlib library.  I thought, why not implement it in pure Ruby, that way there would be no external dependencies.  It would have to be API compatible with the ruby-core Zlib implementation, so it could be used in place of the natively compiled libraries. 

After about a week of hacking on it, I’ve decided to make the initial public release of Zliby.  Right now the only thing that’s implemented is Zlib::Inflate’s inflate functionality and Zlib::GzipReader’s read functionality.  Eventually all of the ruby-core Zlib API will be implemented, and I hope to add other compression support going forward.  Before you ask, yes it’s slower then a native implementation, but it’s portable, and has not be optimized for speed in any way yet.  Also, since it’s being developed for use in IronRuby, there are a few constructs that I can’t currently use (Array#pack for instance) though I will be able to in the future. Comments, feedback, and suggestions welcome!

Links:

Zliby Project at RubyForge

Ruby-Core Zlib API Docs

Zlib Homepage