http://qs321.pair.com?node_id=658266


in reply to Re: Pure Perl Modules, XS Modules, what's the current trends? (allowing easy choices)
in thread Pure Perl Modules, XS Modules, what's the current trends?

I agree with this approach, but what I'm seeing (albeit I haven't looked at every single module that mixes in this way), that modules /used/ to be written like this, but aren't anymore, opting to go for simply an XS route and then someone comes along and writes a Pure Perl version. Which is causing me all kinds of headaches.

For example, in MIME::Base64 2.23 (just as an example), you'll see basically what your diagram is sayin':

eval { bootstrap MIME::Base64 $VERSION; }; if ($@) { # can't bootstrap XS implementation, use perl implementation *encode_base64 = \&old_encode_base64; *decode_base64 = \&old_decode_base64; $OLD_CODE = $@; #warn $@ if $^W; } # Historically this module has been implemented as pure perl code. # The XS implementation runs about 20 times faster, but the Perl # code might be more portable, so it is still here.

(followed by the Pure Perl version)

In the newest version (as of my writing: 3.07) that's gone, but out has sprouted MIME::Base64::Perl - which is probably the same implementation that *was* in Mime::Base64 to start off with.

Seems like a step backwards.

 

-justin simoni
skazat me