News for hackers. Stuff that matters.
Re:Is Perl 6 Being Renamed? by roryrjb on Thursday August 29, 2019 @10:05AM (#20829570)
What good reason is that?
Re:Is Perl 6 Being Renamed? by mkozlows on Thursday August 29, 2019 @10:20AM (#20829710)
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.)

Re:Is Perl 6 Being Renamed? by jasonjayr on Thursday August 29, 2019 @10:32AM (#20829812)
As 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.

Re:Is Perl 6 Being Renamed? by ricardobeat on Thursday August 29, 2019 @11:17AM (#20830242)
I 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.

Re:Is Perl 6 Being Renamed? by jasonjayr on Thursday August 29, 2019 @11:34AM (#20830399)
Don'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.
Re:Is Perl 6 Being Renamed? by earenndil on Thursday August 29, 2019 @07:07PM (#20834569)
What'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.

Re:Is Perl 6 Being Renamed? by ricardobeat on Thursday August 29, 2019 @08:05PM (#20834838)
I'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. Even the widely used DBI package has last seen an update almost a year ago.

Re:Is Perl 6 Being Renamed? by Grinnz on Thursday August 29, 2019 @08:16PM (#20834886)
It 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.

Re:Is Perl 6 Being Renamed? by kbenson on Friday August 30, 2019 @01:49AM (#20836220)
I'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.
Re:Is Perl 6 Being Renamed? by pvaldes on Thursday August 29, 2019 @12:32PM (#20831021)
I 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.
Re:Is Perl 6 Being Renamed? by Grinnz on Thursday August 29, 2019 @12:47PM (#20831205)
This 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.
Re:Is Perl 6 Being Renamed? by ssalazar on Thursday August 29, 2019 @02:48PM (#20832444)
> 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.

Re:Is Perl 6 Being Renamed? by Grinnz on Thursday August 29, 2019 @02:49PM (#20832457)
This thread was regarding Perl 5.
Re:Is Perl 6 Being Renamed? by yellowapple on Thursday August 29, 2019 @02:49PM (#20832450)
> 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.

Re:Is Perl 6 Being Renamed? by deckard1 on Thursday August 29, 2019 @05:19PM (#20833802)
> 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).

Re:Is Perl 6 Being Renamed? by daotoad on Thursday August 29, 2019 @07:44PM (#20834763)
1. 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.

Re:Is Perl 6 Being Renamed? by Grinnz on Thursday August 29, 2019 @05:50PM (#20834051)
To 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.
Re:Is Perl 6 Being Renamed? by eCa on Thursday August 29, 2019 @11:49AM (#20830552)
And 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.
Re:Is Perl 6 Being Renamed? by Grinnz on Thursday August 29, 2019 @10:57AM (#20830049)
1. Carton 2. Function::Parameters, experimental core signatures
Re:Is Perl 6 Being Renamed? by jlv2 on Thursday August 29, 2019 @11:49AM (#20830560)
Why, after 20 years, are signatures still experimental?
Re:Is Perl 6 Being Renamed? by Grinnz on Thursday August 29, 2019 @12:00PM (#20830666)
Unfortunate 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.
Re:Is Perl 6 Being Renamed? by mannykannot on Thursday August 29, 2019 @10:13AM (#20829648)
I still use Perl 5 for some tasks, but my rule-of-thumb is that if I anticipate wanting to use references, I will go elsewhere.
Re:Is Perl 6 Being Renamed? by jerf on Thursday August 29, 2019 @10:42AM (#20829903)
I suggest and use the opposite rule of thumb, "always use references". It tends to simplify things. Python writes the same rule into the language itself.
Re:Is Perl 6 Being Renamed? by mannykannot on Thursday August 29, 2019 @11:05AM (#20830121)
When I used it for larger tasks, I did the same. Nowadays, the consequence of my rule is that Perl 5 sits in my toolbox between Awk and Python.
Re:Is Perl 6 Being Renamed? by ether_at_cpan on Thursday August 29, 2019 @04:12PM (#20833147)
> but my rule-of-thumb is that if I anticipate wanting to use references, I will go elsewhere

Why? References are not scary and they work just like in any other language -- they are simply a memory address that points to another value stored somewhere else.

Re:Is Perl 6 Being Renamed? by mannykannot on Friday August 30, 2019 @08:54AM (#20838064)
The implementation is not the issue; it is the awkward and fussy syntax. It is not a show-stopper -- I coped with it for a while -- but there are better alternatives.
Re:Is Perl 6 Being Renamed? by kbenson on Friday August 30, 2019 @01:42PM (#20840751)
The happy-path syntax is pretty straightforward. I wonder if you're under the impression like some that you need to use the arrow syntax or prefixing dollar for every reference, and not just the first? That's not the case. e.g.

    my @a = (
      { first=>1, second=>"b", another_ref=>["y"] },
      { first=>1, second=>"b", another_ref=>["z"] },
    );

    say $a[0]{first}; # Outputs 1
    say $a[1]{another_ref}[0]; # Outputs z
    
    my $a2 = \@a; # top level is a reference too now
    say $a2->[1]{another_ref}[0]; # Outputs 1, arrow only needed at top level
    
    # The following are alternate syntax that I find unnecessary and better left alone (and most do)
    say $a2->[1]->{another_ref}->[0]; # Outputs 1, explicit, entirely unneeded because it's unambiguous without extra arrows
    say $$a2[1]{another_ref}[0]; # Outputs 1, extra prefixing $ dereferences first level ref
Personally, I'm happy with a single arrow that lets me know if I have a reference or not. References are important, because they denote that this data may be accessed elsewhere as well, so I'm happy to have a small reminder. Inner level references needing a bit of care if they are copied is somewhat normal though, most non-toy languages have some concept of deep or shallow copying.
Re:Is Perl 6 Being Renamed? by mannykannot on Wednesday September 04, 2019 @11:33AM (#20878135)
I rest my case (it is a personal preference, anyway.)
Re:Is Perl 6 Being Renamed? by kbenson on Wednesday September 04, 2019 @12:16PM (#20878634)
Fair enough. I did go a little overboard in the name of completeness. IT just boils down to actually understanding what a reference is in Perl (which is something that needs to be done for anything non-amateur), and then realizing there's one -> or not depending on if it's a reference (and doing the wrong thing will fail, not do weird stuff).

Personally, I like that it forces you to be aware that this data structure is likely in use somewhere else as well, and your changes may not be local (which is true of deeper levels regardless).