4 ms·
Off the top of my head: 1. CPAN was great 20 years ago, but it's a joke compared to modern dependency management systems. 2. Functions don't have explicit par
by mkozlows 7y ago
Off the top of my head:
1. CPAN was great 20 years ago, but it's a joke compared to modern dependency management systems.
2. Functions don't have explicit parameters, and still shift off of @_. (This can be kind of a catch-all for all the "things that are useful for scripts, but suck for programming in the large" design decisions in Perl 5, because I honestly don't remember all of them at this point.)
- jasonjayr 7y agoAs an active perl5 programmer, what do you mean by (1)? To this day, I've seen package management systems for many languages, and none I've seen has been as good as CPAN in terms of (1) Consistent place for distribution + documentation (cpan.org/metacpan.org) (2) Automated testing on a wide variety of platform and configuration (cpantesters.org) (3) CPAN has as standard for declaring dependencies in packages, but a newer "cpanfile" may be more akin go "modern" dependency management. Perl has also had a way of 'use Package $version' right in the source code for ages. (4) the command "cpanm Package::Name" (or even the older "cpan Package::Name") almost always results in figuring out whatever distribution needs to be installed, even if the distribution is named differently from the package name.
- ricardobeat 7y agoI don’t know where you’ve been looking, but none of that is particularly interesting or new at this point. I worked with Perl daily and find CPAN even more of a wasteland than NPM. The average package there hasn’t been updated in a decade and has ancient dependencies to match; takes months / years for clients to be written for new tech.
- jasonjayr 7y agoDon't get me wrong, I'm not disputing that the existing collection of modules on CPAN is languishing, but specific point is that the infrastructure behind CPAN + module distribution is unparalleled by anything I've seen elsewhere.
- earenndil 7y agoWhat's wrong with a package not being updated for 10 years? Languages like perl--like common lisp, and c--are Stable. They change, some, but you can count on old code working. If a 10-year-old package Works, what reason is there to update it? I wrote a c library which has seen no updates in about 2 years--because it doesn't need them. It already does everything I need it to do.
- ricardobeat 7y agoI'm not talking about the 'reached perfection' case. In ten years the language, standards and it's patterns, underlying libraries, hardware, performance, all change. There is also no value in having a working, stable implementation of say, md5 when the entire world has moved on. Often I'll just not find the library I want since nobody using that tech is actually writing Perl. For example, complete lack of a working GraphQL package until late 2017. CPAN search in particular is unbelievably bad. The first result for 'Postgres' is a package last updated in 1998 (not joking), try to find a usable driver here: https://metacpan.org/search?q=postgres https://metacpan.org/search?q=postgres. Even the widely used DBI package has last seen an update almost a year ago.
- Grinnz 7y agoIt is pretty unfortunate that so many people used "PostgreSQL" and "Postgres" in their module name and DBD::Pg didn't, so it gets ranked lower for those queries. But ranking is a hard problem when there is no curation. The MetaCPAN team does want to improve this if possible. As for DBI, it's definitely in the "stable" category and isn't trying to keep up with anything; the DBD::Pg driver though was last updated this month.
- kbenson 7y agoI'm sorry your initial search for a term didn't immediately give you what you're looking for, but the database layer of Perl is very mature, and if you looked at the docs for DBI, you would see that it uses drivers in the DBD namespace, and if you search DBD, postgres is in the first few results, under DBD::Pg. Just like NPM, having a word in your module namespace or description is probably not always very well correlated to module quality or whether it's actually related to that term, so a bit of active research is best to determine what should be used. Then again, I'm not sure NPM is known for providing mobile namespaces that allow third party modules to interact well in a pluggable way, which is quite common on CPAN.
- pvaldes 7y agoI would love to see a upgrade to cpan able to handle names converted to lowercase internally. To remind that you must write "use MymoDuleSQL" instead "use myModuLeSqL" can become pretty frustrating for my tired eyes.
- Grinnz 7y agoThis would be a pretty difficult change. Aside from backwards incompatibility, module names are both filesystem lookups and package stash lookups, and in most cases both of those are case sensitive, and it's entirely possible for valid programs to use two modules that only differ in case - at best I could see a warning that searches for a "did you mean?" but that sounds slow.
- ssalazar 7y ago> Aside from backwards incompatibility Isn't Perl 6 already backwards incompatible? > module names are both filesystem lookups and package stash lookups >> names converted to lowercase internally Converting names to lowercase internally fixes this. > it's entirely possible for valid programs to use two modules that only differ in case Many people (myself included) would see this as a mis-feature not worth saving.
- Grinnz 7y agoThis thread was regarding Perl 5.
- Grinnz 7y ago1. Carton 2. Function::Parameters, experimental core signatures
- jlv2 7y agoWhy, after 20 years, are signatures still experimental?
- Grinnz 7y agoUnfortunate realities of 1) the difficulty of working on the Perl codebase combined with its unpopularity leading to few being both qualified and motivated for such a task, 2) a lack of corporate backing or visionary design purpose driving such features in the language, thus 3) being implemented almost entirely by one individual who had a long period of demotivation and sickness.
- eCa 7y agoAnd regarding 2): Signatures have been in core for several years now, you just need to turn it on. And for back-compat reasons it’s uncommon in CPAN distributed code.
- yellowapple 7y ago> CPAN was great 20 years ago, but it's a joke compared to modern dependency management systems. Modern dependency management systems (at least for language-specific packages) still don't hold a candle to CPAN, IMO. The namespace structure alone is something that's sorely lacking in pretty much every other language-specific package system. I'm glad Perl6 is (finally) gravitating back in that direction (though the prior system of "let's just pull from a bunch of GitHub repos" was still better than 91% of other languages' dependency/package/library/module/plugin/etc. installation approaches, or at least so I felt, having used a lot of such languages). > Functions don't have explicit parameters, and still shift off of @_ I don't see anything fundamentally wrong with this. It's different from other languages, but not necessarily bad (again: IMO). It makes it easier to reason about things like varargs without needing special syntax for it. The class system is similarly deconstructed (i.e. you explicitly "bless" arbitrary data structures instead of relying on the language to automagically do something behind the scenes), and I appreciate that explicitness. --- Like, I find it kinda interesting that the two things you cited as "bad" are also two things I very strongly like about Perl. Different strokes for different folks, I guess.
- deckard1 7y ago> 1. CPAN was great 20 years ago, but it's a joke compared to modern dependency management systems. How so? I use npm/yarn daily and think they are mostly giant insecure playgrounds for teenagers with too much time on their hands. Browsing through node_modules on a large project is enough to make you give up software development and take up heavy drinking. Half the code I see in node_modules wouldn't pass a PR review at my own company. Yet we still depend on it daily. > 2. Functions don't have explicit parameters, and still shift off of @_. Never been a problem in my experience. The expected arguments are generally at the top of the sub. You must really not like functional programming then, with heavy use of curried functions and whatnot. The bigger problem is with passing around an %options hash, and this is true of JavaScript as well, is that the keys can be easily mistyped leading to bugs. Not even TypeScript fixes this (because developers are generally horrible about defining types, which have to be defined perfectly).
- Grinnz 7y agoTo the second point, named parameters as implemented by Function::Parameters do provide this checking if you want it to. Named parameters was a planned feature for core signatures and hopefully it will have similar functionality.
- daotoad 7y ago1. Absolutely my experience. NPM is pain. 2. Whether you go positional or use an options hash, you still need to carefully unpack your args at the top of the subroutine. And do it consistently. There are a ton of libraries to help with this, too. The most important thing is to pick a house style and do it everywhere that doesn't need to be different.