|The stupid question is the question not asked|
Pure Perl Modules, XS Modules, what's the current trends?by skazat (Hermit)
|on Dec 20, 2007 at 19:33 UTC||Need Help??|
skazat has asked for the
wisdom of the Perl Monks concerning the following question:
If you look at my writeup history, you'll see that many of the questions I pose are about getting complex web apps working, without the help of CPAN. I love CPAN myself, but a lot of regular users don't know how to use it, nor a CLI, etc. My webapps started with manual configuration (think webapps written in php) in mind and I'm slowly working up to having something that can be distributed on CPAN, without alienating my users who are used to the way it's been for yarns of years. I am looking forward very very extremely much to using something like Module::Install to get the dependencies I need for the webapp, but I still need a fallback plan for other users (right now, it's probably the majority of the users)
One of my main issues is trying to package up the needed CPAN modules my webapps require into a perllib that can just be included with the webapp.
The other issues I have is figuring out what to do with a CPAN Module that has a dependency chain that includes an XS module. This is a type of module that I can't easily include, since it has to be compiled, etc.
One of the things I'm noticing is that some newer XS perl modules are shipped without a Pure Perl Implementation to fallback on, but there's another Pure Perl Module implementation by someone else, that attempts to closely mimic the behavior of the first one.
For example, an older module that has a fallback behavior would be something like MIME::Base64 (or, geez, used to)
This new trend, I'm noticing in things like Text::CSV_XS and Text::CSV_PP, as well as Crypt::Rijndael and Crypt::Rijndael_PP. Now I see there's also a MIME::Base64::Perl
At the moment, I basically keep good track of what CPAN modules I use and keep them in a app-specific perllib and also say in the dev notes that this is so, and it'd be a good idea to install these modules yourself (a Bundle is used, at the moment)
I say things like this:
WebAppx uses CSV files, which, by default is handled by Text::CSV_PP - but you'd be better off using Text::CSV_XS, but! Please install this yourself and WebAppX will know what to do. Hazzah! I'm wondering what the best way to have this in code. Right now, I do something like this:
It seems somewhat scrappy and wasteful.
I know of the Best module, but the low version number and long-time-since-hacked-upon date makes me wonder how good it'd work as well.
I'm also starting to work with CPAN authors in helping to get their modules who have dependency chains that include XS modules to have a Pure Perl implementation (hey, if it's already there, why not?)
Is there a better method that you guys use? I hope people can understand the importance of having a fall back, pure perl implementation of some of these modules. I do understand that in many instances, these modules are much much slower, but it is better than nothin'.