From: Michael Neumann Date: 2001-10-30T03:17:04+09:00 Subject: [ruby-talk:23738] Re: Some inspirations from REBOL Ryan Leavengood wrote: > > > R6. Compression built-in > > ------------------------ > > compressed_string: compress string > > > > to compress and > > > > decompress compressed_string > > > > to decompress > > > > RF comment: I think we need to add this ASAP. And written in Ruby not > > in extension. We need portability. > > > > I think Ryan Leavengood has planned to add zlib's deflate > > algorithm. That's probably good since its so common but I'd propose > using > > LZO since its the fastest when decompressing and still compresses > almost > > as good or sometimes even better than deflate. This can be important > if > > the gems can be compressed and needs to be decompressed by > interpreters > > when loaded. Look at > > http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html. The license is GPL so > not > > a problem, or? > > My work on deflate has been postponed for some time while I work on > RubyGems. I actually wasn't able to get the decompression working (nor > the compression which I haven't even started on yet.) But I have the > basic algorithm written. I think it is just a matter of the way I'm > handling the bits. > > I took a quick look at the LZO page and it looks like an interesting > alternative to deflate (though I agree that deflate support is still > needed.) It might be easier for me to do LZO first since it sounds like > an easier algorithm (though I haven't looked at the details yet.) > Deflate is a little complicated since it combines Huffman coding with > some LZW type stuff. > > In the long run I think having support for the major non-patented > algorithms (deflate, LZO, bzip2) in pure Ruby would be great. Maybe great, but very slow. Why not make it a standard C-extension and distribute it with Ruby? It would run on any platform. I've implemented LZ77, LZ78, LZW, RLE and BWT (bzip) in pure Ruby and they are really slow. Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de