News for hackers. Stuff that matters.
Re:Is Perl 6 Being Renamed? by mkozlows on Thursday August 29, 2019 @10:33AM (#20829823)
I mentioned it in another comment, but a really obvious one is that functions in Perl don't have parameters. Every function just takes in a list, and can do whatever it wants with that list. This page gives a good overview of the situation: https://perl101.org/subroutines.html

There's a kind of elegant flexibility to that, but it also makes it really hard to program reliably in the large, to build useful tooling, or even to glance at a function and know what you should pass it.

Beyond that, classic Perl was full of things that make it quick to write small programs (as CGI scripts were at the time) without a lot of boilerplate, but which don't scale up.

(Perl 6 is very different, and has an almost comically flexible/powerful function signature system (https://docs.perl6.org/type/Signature). Whether or not you like Perl 6's stuff, it's nothing at all like Perl 5's.)

Re:Is Perl 6 Being Renamed? by bmn__ on Thursday August 29, 2019 @11:42AM (#20830494)
> functions in Perl don't have parameters

Sorry, you are misinformed. That hasn't been true for a long time, see http://p3rl.org/Kavorka::Manual::Signatures

Other languages would kill for this kind of beyond-complete maximum overkill feature set.

> This page gives a good overview of the situation: https://perl101.org/subroutines.html

No, it doesn't. That page is not wrong, but incomplete and teaches the wrong stuff, wouldn't recommend. Instead see http://perl-tutorial.org/ for recommended tutorials.

Re:Is Perl 6 Being Renamed? by iosonofuturista on Thursday August 29, 2019 @12:22PM (#20830907)
So, the first tutorial on the list that you recommend has this page for functions[0]. It's more or less the same as GP's link.

YOU are the one misinforming, it would seem. Granted, I don't work with perl (5, never tried 6) for about 15 years, but most criticism of it seems to align with my experiences back then.

[0] http://mvp.kablamo.org/basics/functions/

Edit: The second [1] also recomends the @_ method, and the third [2] the shift method. Did you even read your own links?

[1] https://perlmaven.com/subroutines-and-functions-in-perl [2] https://learnxinyminutes.com/docs/perl/ (search for subroutines)

Re:Is Perl 6 Being Renamed? by rubinelli on Thursday August 29, 2019 @12:17PM (#20830866)
From the Perl 5.30 documentation:

> WARNING: Subroutine signatures are experimental. The feature may be modified or removed in future versions of Perl.

https://metacpan.org/pod/perlsub

Re:Is Perl 6 Being Renamed? by mmcclimon on Thursday August 29, 2019 @12:44PM (#20831157)
It's true that they're experimental, but it's extremely unlikely they'll be removed. The only reason they weren't stable in the most recent version of perl is because of some interactions with subroutine attributes (specifically, :lvalue) which needed some tweaking. We use them everywhere at Fastmail and they're great.

Which is to say: a lot of the reason they're still experimental is because Perl's commitment to backward compatibility. Other languages might have said "oh well," but Perl 5 said "oh, an unintended consequence that might break real uses in the wild; we should wait another year."

Re:Is Perl 6 Being Renamed? by marcosdumay on Thursday August 29, 2019 @01:21PM (#20831602)
In my experience, I never got positional parameters to reliably work on Perl5. They were always buggy and would break with completely unrelated changes.

On Perl6 those are officially supported, so I imagine they work.

Re:Is Perl 6 Being Renamed? by xorcist on Thursday August 29, 2019 @02:06PM (#20832062)
There is a certain elegance to bare lists, as any lisp programmer will probably agree with. It enables the programmer to build their own abstractions as they go.

That is also true for the overly simple object model of Perl 5, it is more like an OOP construction kit, which enables things like Moose which has for almost 15 years provided Perl 5 with a very flexible object model.

It would be very interesting to know if anybody knows of similar systems for other languages?

Large OO codebases can be downright nasty to navigate and while I have never had the opportunity to use something like Moose for large scale projects I imagine that's where it would shine.