33 ms·
Fun fact: Perl probably encompasses more supporting library code than any other language other than C. The Comprehensive Perl Archive Network (CPAN) currently
by peterwwillis 13y ago
Fun fact: Perl probably encompasses more supporting library code than any other language other than C.
The Comprehensive Perl Archive Network (CPAN) currently has 123,757 Perl modules in 28,037 distributions, written by 10,829 authors, mirrored on 270 servers.
Back in 2004 (almost 10 years; there's been some developments since then) someone ran SLOCCount on all of CPAN, and it estimated the development cost at about $677 million dollars. http://web.archive.org/web/20041010230806/http://www.etla.org/cpan-sloccount-report.txt http://web.archive.org/web/20041010230806/http://www.etla.or...
Before you choose another language for your project, ask yourself if it's not going to cost more to write everything you'll need, or if using pre-existing, time-tested code might do the trick for cheaper.
The one downside about Perl that I think is the most unfortunate is the ninja aspect. You have to be a Perl ninja to write good Perl code. There's no two ways about it. If you come from a different language, you have to ignore all the rules and guidelines you used to develop in, and learn the Perl way, or be ye damned. Which is why most Perl code you've been forced to maintain sucks.
- drsintoma 13y ago> Before you choose another language for your project, ask yourself if it's not going to cost more to write everything you'll need, or if using pre-existing, time-tested code might do the trick for cheaper. I believe 99.9% of the people will find any libraries they need in pretty much any mainstream language. There is a point where quantity stops being a factor.
- walshemj 13y agofrom experiance python and other more modern languages just dont have the coverage of CPAN. Some of us just want to get shit done and not rewrite the wheel (and debug it).
- ChuckMcM 13y agoPython also had to contend with the 2.x/3.x split which, for some people, feels like two different languages. So there is a 'stability' aspect (which is not changing fundamental things). Perl 6 is having those issues, too much change and its threatening to hemorrhage a bunch of CPAN. Having been present at the 'birth' of Java and watching the forces at work on it as a language and on it as an environment. I find the forces that change languages interesting. And the question about when to change the language versus when to fork it and make a new language much more complex than I expected.
- CatMtKing 13y agoI prefer being able to debug it. (Or maybe more accurately: not spending hours upon hours trying to debug it)
- peterwwillis 13y agoHere's one example of what i'm talking about: http://poe.perl.org/ http://poe.perl.org/ It's a framework for writing reactive programs so you don't have to write all the glue normally associated with event-driven apps. It's got 1,044 framework-specific modules to take advantage of (in addition to making it easy to write them yourself). There's a point where the wheel's already been made and trying to find a better one stops being a factor.
- andrewvc 13y agoThat's mostly a function of age*avg.popularity.per.year. Java, python, ruby, etc. have been around long enough that available libraries are equivalent if not better. A lot of CPAN's libs are likely cruft from the language being so old, the size of it says nothing. What's more interesting is how often libraries are updated with new code, and how often people use them.
- peterwwillis 13y agoOh, right, old code. CPAN is funny in that they have a central location to test multiple versions of code on multiple platforms and comment/patch them over time. I don't know of anything similar for any other language, probably because there isn't a CPAN equivalent for any other language (edit: there is JSAN and CCAN, but not quite the same). http://stats.cpantesters.org/ http://stats.cpantesters.org/ Want to see how old code stacks up in testing? Let's pick a module and see all its dependencies and their test results. XML::Feed as a random example: http://deps.cpantesters.org/?module=XML%3A%3AFeed&perl=latest&os=any+OS http://deps.cpantesters.org/?module=XML%3A%3AFeed&perl=lates... Hmm, says no results for some of them. Let's drill down and select HTTP::Negotiate to see its test results. http://www.cpantesters.org/distro/H/HTTP-Negotiate.html http://www.cpantesters.org/distro/H/HTTP-Negotiate.html Looks like the latest version has been tested on lots of platforms, and it's good! Let's pick a different piece of code, something older, say from 2005? https://metacpan.org/release/DOMIZIO/CGI-Builder-CgiAppAPI-1.27 https://metacpan.org/release/DOMIZIO/CGI-Builder-CgiAppAPI-1... http://www.cpantesters.org/distro/C/CGI-Builder-CgiAppAPI.html http://www.cpantesters.org/distro/C/CGI-Builder-CgiAppAPI.ht... Ah! So we see the last version it worked with and on which platforms, but on the latest perl it's failed its tests. We can drill down and see why the tests failed: http://www.cpantesters.org/cpan/report/c91a8b7c-4983-11e1-94c9-6af50df65b4f http://www.cpantesters.org/cpan/report/c91a8b7c-4983-11e1-94... Hmm, unprefixed autoloaded parameter. That's probably not too difficult to fix. I guess even though there's old crufty code that isn't always maintained across versions, we have pretty good visibility into when something failed, and with good tests we know why and how to fix it. There's a lot more resources to take advantage of through CPAN, like bug trackers, review sites, development wikis, etc. http://en.wikipedia.org/wiki/CPAN http://en.wikipedia.org/wiki/CPAN
- MichaelSalib 13y agoHow many of those modules only exist to compensate for weaknesses in the core language though? For example, looking at http://search.cpan.org/~pevans/Scalar-List-Utils-1.30/lib/List/Util.pm http://search.cpan.org/~pevans/Scalar-List-Utils-1.30/lib/Li... just befuddles me: every function is a one-liner or built-in in Python and most reasonable modern languages. Yet Python's stdlib is much smaller than Perl's. Note that the module in question has to have a bunch more functions than necessary in order to work around more problems in the core language: you need sum0 in addition to sum because you can't just use default arguments and you need both min/max and minstr/maxstr because context dependent type interpretation confuses everything. Of course, this doesn't generalize at all to other types besides strings in contrast to python's keyargs. Frankly, the notion that I need to download an external module in order to do something as basic as finding the largest element of a list seems just bizarre. The real problem here is that instead of having a small orthogonal core that everyone can learn and use, you have an incredibly complicated core that no one really understands that devolves lots of basic functionality to a giant network of modules. I think the perl community works incredibly hard at writing lots of CPAN modules to try and correct for perl's defects. But 100,000 bandaids isn't something to be proud of.
- peterwwillis 13y agoFirst: you're confusing "missing feature" with "weakness". Some people actually prefer not having 100,000 built-ins. IMHO comparing how you eat an apple with how you eat an orange is stupid. It's not the same fruit, and they work a little differently, and that is okay. If you prefer eating apples because you think the way to eat oranges is stupid, that is okay too. Second: You don't have to use a module to find the largest element in a list. But you can if you want, and you may find the module does it better than you do. Also, List::Util has been shipped with core perl since 5.8.0, so you don't have to download it. Third: Perl does have a small core that everyone can learn and use. The fact that you don't understand it or what modules are for does not discredit it.
- MichaelSalib 13y agoSome people actually prefer not having 100,000 built-ins Have you actually ever looked at Python? The core language is pretty small; much smaller than perl certainly. My point is that if you design the core well enough with orthogonal components and capabilities, you can give people the equivalent of many thousands of purpose-built modules. I have no idea what you're trying to say with your fruit analogy. Perl does have a small core that everyone can learn and use. That hasn't been my experience; the core language seems to have a staggering number of rarely used quite odd features that accumulated early on. It seems extremely hard to write a new implementation of perl that supports all that cruft; one can't even parse perl correctly except by using the existing implementation.
- bch 13y ago...which is why I build simple Tcl <--> C shims to C libraries and get on w/ enjoying my programming environment/experience.