R
Roger Pack
Looks like you and Charles L. are in a race.
Maybe you can collaborate?
Let us know when somebody think it's about done
-=r
Looks like you and Charles L. are in a race.
I dit it all by hand. There is no royal road to translating C to Ruby2009/1/8 Charles L. said:Heh. Somehow I think he's got it covered. That reimplementation of
zlib in ruby is actually pretty cool. I'm curious Park, as to how much
you did by hand and how much you were able to automate it...?
I've put the deflate code i wrote on pastie - http://pastie.org/355367
It's about 600 lines, but needs cleaning up. Will probably be ~500 when
I've added in dynamic trees and cleaned it up a bit.
Prelim benchmarks show the current bottleneck to be the LZ77
implementation which is interesting. I think for it to perform
acceptably, a lot more of the code needs to become more idiomatic,
higher-level ruby.
Hi,
)
I dit it all by hand. There is no royal road to translating C to Ruby
In my test, the deflation is very slow but the inflation is endurable.
Moreover, for the compatibility of the various Ruby version, It shows
bad performance in Ruby 1.8.x.
Roger said:Maybe you can collaborate?
Let us know when somebody think it's about done
-=r
Finally I translated the whole zlib.c to ruby code.2009/1/8 Daniel Berger said:Excellent, thanks!
As long as it's usable I'm happy. We can benchmark, profile and
optimize later.
uby-zlib/tree/masterI'm not sure there's much room for collaboration at the Zlib wrapper &
below level, but perhaps the GzipFile and upwards (ie Reader/Writer)
implementations can be shared.
The big thing is just good specs, and the existing rubyspec ones could
use some work which will benefit all of us.
Agreed.
I've added most of the remaining missing functionality to my version (ie
dynamic huffman tree's etc), and added back in the inflate functionality
from zliby, and put the result up on github -http://github.com/aquasync/r=
I've since added enough of the GzipWriter & GzipFile functionality that
the existing specs all pass (see below. note the GzipFile specs use
GzipWriter). Unable to push this last commit to github presently, but
will try later.
) 7
Finally I translated the whole zlib.c to ruby code.
You can download athttp://121.78.227.9/rbzlib/pzlib.rb
uby-zlib/tree/masterI'm not sure there's much room for collaboration at the Zlib wrapper &
below level, but perhaps the GzipFile and upwards (ie Reader/Writer)
implementations can be shared.
The big thing is just good specs, and the existing rubyspec ones could
use some work which will benefit all of us.
I've added most of the remaining missing functionality to my version (ie
dynamic huffman tree's etc), and added back in the inflate functionality
from zliby, and put the result up on github -http://github.com/aquasync/r=
Daniel said:Ok, I was able to download the project and I ran the specs:
C:\ruby\src\ruby-zlib>spec specs
.............FF.......................
1)
'Zlib:eflate#params changes the deflate parameters' FAILED
expected: "x\001\000\v\000\364\377abcdefghijk\002,'\027\000#
\364\005<",
got: "x\234KLJNIMK\317\310\314\312\316\311\005\000#
\364\005<" (using ==)
C:/ruby/src/ruby-zlib/specs/deflate/params_spec.rb:16
2)
NameError in 'Zlib:eflate#set_dictionary sets the dictionary'
uninitialized constant Zlib:eflate
C:/ruby/src/ruby-zlib/specs/deflate/set_dictionary_spec.rb:6
C:/ruby/src/ruby-zlib/specs/deflate/set_dictionary_spec.rb:5:in `each'
C:/ruby/src/ruby-zlib/specs/deflate/set_dictionary_spec.rb:5
Finished in 1.688 seconds
38 examples, 2 failures
Ruby 1.8.6-p114 built with VC++ 8
Windows XP Pro
RSpec 1.1.11
Regards,
Dan
I fixed some typo and renamed PZlib to Zlib and pzlib.rb to zlib.rb2009/1/10 Daniel Berger said:Hi,
Looks very promising but doesn't quite work yet:
C:\>gem install ptools
ERROR: While executing gem ... (NoMethodError)
undefined method `ZSTREAM_IS_FINISHED' for #<Zlib::GzipReader:
0x2f8e8bc>
I think you need some tests.
BTW, I'm assuming this is basically a wholesale replacement of zliby?
If so, the module should be renamed from PZlib to just Zlib.
Otherwise, Rubygems will complain about the lack of a Gem::Zlib
definition.
Keep up the good work!
Yeah the github download functionality seems broken for me most of the
time also... :/
Anyway, the params failure is the only failure I get. Thats because I've
not implemented the NO_COMPRESSION mode yet, and is an easy fix. The
other error you're getting is odd, as Zlib:eflate is defined, and if
it weren't none of the other deflate specs would have passed!
Yeah the github download functionality seems broken for me most of the
time also... :/
Anyway, the params failure is the only failure I get. Thats because I've
not implemented the NO_COMPRESSION mode yet, and is an easy fix. The
other error you're getting is odd, as Zlib:eflate is defined, and if
it weren't none of the other deflate specs would have passed!
On Jan 9, 9:26=A0pm, "Charles L." <[email protected]> wrote:
Anyone knows any web application for bounties? I'm interested in
contribute to this one and also one for Readline!!!
I can live without a pure Ruby readline (though I'd certainly welcome
it). I'd rather have a pure Ruby OpenSSL.
Hopefully that is not necessaryOk, I'll look for it and just copy/paste files individually when
you're ready.
Hi,
There's a project out there called "zliby" [1] which partially
implements the zlib library. Unfortunately, only the Zlib::GzipReader
class has been implemented so far. I'd like to have a pure Ruby
implementation of the Zlib::GzipWriter class.
I've put in a feature request [2] but I'd like to see it expedited. In
order to expedite this, I'm offering $100 to anyone who can implement
it. In order to qualify for the bounty, your Zlib::GzipWriter class
must meet the following criteria:
* It must be pure Ruby. No extensions. No FFI.
* It must have tests (and pass them)
* It must match the current Zlib::GzipWriter interface
* It must be cross platform
* It must be able to generate a proper gem file from a gemspec (the
acid test)
* It must be contributed back to the zliby project
* It must be done within 60 days of this post
Daniel said:So, congratulationns to Park Heesob for not only creating a
Zlib::GzipWriter implementation, but for also creating a pure Ruby
version of the underlying zlib 1.2.3 library!
WOOHOO!
Regards,
Dan
[1] However, I hate to see Charles go unrewarded for his wonderful
efforts, so any matchers are free to distribute their bounties as they
see fit.
There's a project out there called "zliby" [1] which partially
implements the zlib library. Unfortunately, only the Zlib::GzipReader
class has been implemented so far. I'd like to have a pure Ruby
implementation of the Zlib::GzipWriter class.I've put in a feature request [2] but I'd like to see it expedited. In
order to expedite this, I'm offering $100 to anyone who can implement
it. In order to qualify for the bounty, your Zlib::GzipWriter class
must meet the following criteria:* It must be pure Ruby. No extensions. No FFI.
* It must have tests (and pass them)
* It must match the current Zlib::GzipWriter interface
* It must be cross platform
* It must be able to generate a proper gem file from a gemspec (the
acid test)
* It must be contributed back to the zliby project
* It must be done within 60 days of this post
<snip>
And the winner is...Park Heesob! We actually had two competitors for
the bounty (much to my surprise), and it was very close (again, to my
surprise), but in the end Park's code passed an acid test that
Charles' code did not.[1]
So, congratulations to Park Heesob for not only creating a
Zlib::GzipWriter implementation, but for also creating a pure Ruby
version of the underlying zlib 1.2.3 library!
WOOHOO!
Regards,
Dan
[1] However, I hate to see Charles go unrewarded for his wonderful
efforts, so any matchers are free to distribute their bounties as they
see fit.
Luis said:I have some bucks with Park and Charles names printed on them ;-)
Park: I have your Paypal info, will send you as soon as possible.
Charles: can you tell me your paypal email?
Again: do anyone knows a good platform to to bounties for open source
projects?
Regards,
Jano said:What parts of OpenSSL? ;-)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.