in reply to Parsing of serialized data

The approach is sound.   It may be that it is perceived to be more difficult to generalize, into a serviceable CPAN contribution.   Or, it simply may not have been done yet.

The stuff that gets contributed is often more-or-less the “finished product of” someone who worked a long time on something and then decided to share it.   That tool, having been built from whatever was readily available at the time, might not have been devised as a contribution; as “a better mousetrap.”   It might have been offered from the perspective of, “you might spend a little less time whacking on code if you whack on this instead of whacking from scratch:   Your Mileage May Vary.™”   Which, of course, is often a Good Thing, itself.

However, if you are now “signing up” . . . :-D

Replies are listed 'Best First'.
Re^2: Parsing of serialized data
by andal (Hermit) on Oct 28, 2010 at 11:38 UTC

    Well. The term "generalize" that you have used slightly scares me :) Do you mean that it will be difficult to describe the module so that it is understood how to use it?

    Generally speaking, it is not so hard to create such module for HTTP parsing. I have written one in C, so probably in Perl I can write one in 1-2 days. Maybe that is why such modules are not offered? Those who could have used them spend less time in writing them than in searching and understanding the documentation :)

      If you have put in the legwork on a good, generalized “HTTP parsing” solution ... that is a better mousetrap ... and that can be built to the standard-of-quality of CPAN such that you are actually willing and able to do it, then of course there will be great interest in what you have done.

      If you really can “Name That Tune™ in two days,” then by all means, go for it.   What we all will expect is a thoroughly implemented and self-testing module, with at-least adequate documentation and generalized applicability, such that thousands of other people can “drop in” your solution to their applications and actually save time thereby.

      Naturally, it will behoove you to thoroughly understand what is already out there, and why your work is distinctive and different.   It is quite frequent, and quite embarrassing, to discover that you have poured heart-and-soul into an effort that did not need to be done at all.

      Nevertheless:   If you’ve got a better mousetrap, heh, we are certainly not running short of mice.   There are many thousands of CPAN modules, and always room for one more.   I say these things to encourage you to get busy.   The Hall of CPAN Contributors (oddly, I myself am not one ...) is a hallowed hall, indeed.

        Aha, now I understand what generalized means :)

        Obviously, this is all true. And it might be the reason why some modules don't end up in CPAN. On the other hand, there are thousands of modules there. But the modules that provide the interface I've described are the minority. So the generalization process shouldn't be the explanation for this situation.

        Just to be clear. I'm not trying to find an excuse for not attempting to share some of my work. I'm trying to understand why nobody had shared similar work already. There are lots of modules that handle HTTP by reading sockets, why there are almost no modules that just parse HTTP without handling sockets? :) So far, my guess is, such modules are considered to be too complex for "drop in" usage, so nobody feels like going that way. Effectively, this can be called "design flaw".

        Another example. XML parsers. The perl module XML::Parser uses the underlying expat library. The library itself uses the "Parser" approach. Ie, it processes data as the user provides it. Nevertheless, the XML::Parser does not provide the same interface. Instead it provides the front-end that does the reading for the user. (Well, there's XML::Parser::ExpatNB module that provides the "pure" expat interface). The point is, the creator of XML::Parser wrapper also considered the approach taken by expat author to be too complex. No need to mention, that the most popular way to parse XML is to let the parser create the object and then search in that object for the nodes that are interesting. This is what most of modern parsers offer.

        So, it seems that even though the "divide and conquer" approach to data parsing promises lots of flexibility, in reality it is not used because majority of developers favor simpler interfaces over the flexibility.