From: trans Date: 2009-06-13T17:54:06+09:00 Subject: Re: pr-zlib 1.0.0 - A Pure Ruby zlib library On Jun 13, 12:02 am, "Daniel Berger" wrote: > Hi all, > > The Pure Team is pleased to announce the release of pr-zlib 1.0.0. > > = What is it? > > The pr-zlib library is actually two separate libraries packaged together. > The first, rbzlib.rb, is a pure Ruby port of zlib.h (the C library). It's a > module that you can mixin and use as you see fit. The second, zlib.rb, is a > pure Ruby version of the Ruby interface to the zlib C library that ships as > part of the Ruby standard library. > > = How do I get it? > > gem install pr-zlib > > Or, just go the RubyForge project page athttp://www.rubyforge.org/projects/pure, download the source and run either > 'rake install' or 'rake install_as_zlib' (which will install the library as > 'zlib' instead of 'pr/zlib'). > > = How do I use it? > > require 'pr/zlib' > # The rest is the same as the zlib that ships with the Ruby stdlib. I wonder if this would be more desirable actually in the standard library for the reasons you give. > = Why? (Also in the README) > > First, building the zlib C library on MS Windows with Visual C++ is very > difficult. However, certain libraries depend on zlib, most notably rubygems. > By providing a pure Ruby version we eliminate any compiler or platform > compatibility issues. > > Second, even some Unix distributions, such as Debian, do not ship with the > zlib library by default. By creating a pure Ruby version of the zlib library > we eliminate the need to install a 3rd party C library, and eliminate a > potential weak link in the dependency chain. > > Third, by creating pure Ruby versions of the library and the interface we > are more likely to receive patches, feature requests, documentation updates, > etc, from the Ruby community (I hope) since not everyone who knows Ruby also > knows C. > > Last, the zlib interface that ships as part of the stdlib is a little on the > clunky side IMO. By providing a pure Ruby version, authors can create their > own interface as they see fit. Good show, gents. Maybe some benchmarks? T.