Live data from Hacker News

Is Perl 6 Being Renamed?

blogs.perl.org

401–410 of 424 posts

Re: Is Perl 6 Being Renamed?

#401

Earlier quoted context omitted.

Okay, but is it a good, useful programming language? In some ways, the long development timeline suggests a slower, more stable way of doing language changes that appeals a lot to me.

I think so. I regularly use JS and Java in daily life and used to use a whole host other languages in the past. Perl 6 is actually a joy to code in, as weird as that sounds. It's fairly straightforward to begin using, but the deeper I go the more I see the huge benefit to its long development which was mainly in spec-writing. The two killer features (for my work, at least) have been the grammars (a sort of regex on s…

The type system and multiple get rid of so much “if this then do that” code.

  multi sub eat-pie( Pie slice where *.is-custard ) { ... }
  
  multi sub eat-pie( Pie slice where *.is-fruit ) { ... }

  multi sub eat-pie( Pie slice ) { ... }

  eat-pie( a-slice-of-pie );
That’s just awesome.

Re: Is Perl 6 Being Renamed?

#402

I learned Perl4 in grad school and it was a life changing tool to automate my analysis workflow. With it I was able to script complex solutions that drove stepper drivers and CCD cameras on a microscope for data and image collection. I stayed through the Perl5 change over and thought it was good. Then I tried OO programming. And cried. And read that Perl 6 would make it better. But I needed something now, on a window…

If you like OOP you should check out Moose and Moo in Perl 5. https://metacpan.org/pod/Moo

If you want regular Perl5 for Windows, Strawberry Perl is quite nice. http://strawberryperl.com/

Perl6, OTOH, has powerful OOP features like traits all built on a powerful, standard meta object protocol. Its functional programming features have evolved beyond Perl5's excellent support.

Come back and try these things out.

Re: Is Perl 6 Being Renamed?

#403

Earlier quoted context omitted.

Larry was trained as a missionary and educated as a linguist. He came to language development with the perspective of a linguist. This is why Perl has context and pronouns. There's a scalar vs. list context when calling a subroutine. Some Perl builtins return different things in the different contexts. Your subroutines can as well, for example by using wantarray() in your code. For example, in list context returning…

Ok, the analogy of magic variables as pronouns actually makes them make a little more sense as a concept, even though I still don't think that the ambiguity of meaning is a useful feature in a programming language overall. In a natural language an ambiguous pronoun can be clarified by a later sentence - hell, the appropriate context could come quite a bit later on if that's the intention, and comedy certainly uses th…

There's quite a bit of depth to Perl, yes.

People looking at it for the first time often look at the variables available, the built-in functions and procedures available, the fact that regularish expressions have their own mini language that nests naked inside the main syntax and a few oddities like sigils and sometimes determine there's a huge breadth-first search to learn all of this. People almost immediately go to, "even if I don't need to use all of this, I need to understand all of it to maintain other people's code". If you follow a really unprincipled developer who's showing off, that may be the case.

I've been programming in Perl5 for some part of my job duties since 1998. In high school before that, I was studying two foreign human languages and was taught the basics of four or five programming languages. At university I started a third foreign language and another programming language. All this time I was also learning a bit of programming language here and there on hobby projects. I've learned several more programming languages since, some of which I use alongside Perl pretty much daily.

From my experience the core language of Perl5 contains a subset of the language which could be thought of as its virtual core language. Much of what's built in is used more like specialty modules that are only used when necessary. I think this has a lot to do with Perl up through the Perl 4 days not having great module support. There are other huge languages in the wild. Ada, PL/I, and any shell on a system with a big bin or sbin directory come to mind. It really is, in my experience, a depth-first language with lots of side paths to explore one at a time. I don't have hard data on people learning the language, but I've met many people who share this sort of thoughts about it.

One solid example of a core feature that's really complete but rarely used is formats. You can have output sent through these sieves that are a template language built into core Perl5. They are really handy if you're using Perl to match a format in RPG or COBOL or if you're just generating the sort of reports you might generate from those. You don't ever need to worry about them if you're not working on code that does that. I've written Perl formats two or three times and had to deal with them in maintenance maybe half a dozen times including the ones I wrote. There's a separate manual document on them. They are not part of the core in Perl6/Raku but someone's older program would break if they were taken out of Perl5. https://perldoc.perl.org/perlform.html

There's a separate document for pack() and unpack() which are very handy if you're hand-translating character sets or working with a binary protocol or something. Otherwise you'll not use those, but they are in that huge core language.

The data structures and references in Perl5 look different than in many other languages. There are docs on syntax, and others on referces, and then another specifically on data structures. Perl6 uses similar dot notation to other languages, which is one of the syntactical incompatibilities with Perl5.

One place where the "all those choices" is a real drawback is the number of ways to make and use objects in Perl5. The initial way Larry gave us is workable and performant but a bit ugly and utilitarian. Many CPAN modules brought their own module systems. Then, after the Perl6 team figured out what they wanted to do for objects, Perl5 got a backport called Moose. Moose is nice to use but is a behemoth and uses memory like one. Someone came along and gave us a lighter version named Moo, and then someone gave us Mouse and another group gave us Mo. In the industry and community, Moo is considered the best practice now. It even upgrades just specific objects to full Moose objects if the lightweight version won't do for some reason. So if you can write and maintain Moo code and the original Perl5 blessed data structure objects you're good for most object-oriented Perl code, but far from all. There's also Object::InsideOut, Class::Accessor, and I forget how many others.

One place where Perl6/Raku/Camelia really fixes things is having a really nice default object system. Another place it fixes things is there's really no need to graft another object system on in place of it, because it include a full and fully accessible MOP.

Re: Is Perl 6 Being Renamed?

#404
post #229

Earlier quoted context omitted.

Writing and reading Perl was meant to feel more like producing and consuming natural language. When in comes to natural language, our ability to use it for practical purposes is a fact, and whether it can be understood rigorously or shoehorned into a logical framework is an academic question. With that in mind, Perl was designed without regard for whether the everyday user of the language could understand the logic b…

> or that "black big dog" is as valid as "big black dog." Tangentially: it is, though; the two phrases are both valid, but have different meaning. “big dog” is an idiomatic phrase that, when used as such, functions as a single noun, which can be modified by “black” as a preceding adjective (if “black” is in the usual place between “big” and “dog”, the words have their individual meaning not that of the idiomatic phra…

> “big dog” is an idiomatic phrase

Not a super common one though, and even if you were using the idiom you wouldn't write "black big dog" because it still sounds incorrect and makes it less clear you're using the idiom.

Re: Is Perl 6 Being Renamed?

#405

To my mind, the blockers for Perl 6 adoption in order of importance have been: 1. The name, saddling it with the legacy of Perl. (I say this as someone who really liked working with Perl back in the waning years of the old millennium, and believes that Perl was visionary in pointing the way to the state of modern programming... but also that it had some limitations that have only become more glaring over the years.)…

> But why do people talk about ParrotVM and Rakudo as if they're different things? Java has a compiler and a VM, they're called "javac" and "jvm." Bad example: Java actually has many VMs available for it: Oracle, OpenJDK, Zing, and IBM come to mind. (EDIT: And "Dalvik", for all the Android fans). I'm unsure if Java has multiple compilers, but its quite possible. Python has CPython 2.0, CPython 3.0, and Jython at leas…

The biggest mistake IMHO was calling the perl language spec for 6.x "Perl". Because it took so long to finish and to get a proper implementation, a lot of people thought perl as a whole was mostly dead.

For the most part, language specs are either bundled fairly tightly with a reference implementation, or have a completely different name. (e.g. ECMAscript, SQL)

Re: Is Perl 6 Being Renamed?

#406

Earlier quoted context omitted.

Except that the vast majority of those OCRs are just a series of letters. They all parse as "a variable name, that's it", and it's not even weird for that to be a valid line. It's the kind of joke that doesn't teach you anything, rather than the kind that does.

I think there are a couple of neat examples there: lerzfijglpFiji-j -*? plus I learned about the "unquoted string" feature that is the reason why the joke works also, the writing is quite entertaining.

It's not so much a feature as how really old versions of Perl worked. Any program using strict doesn't allow it unless it's a known subroutine name, built-in or other symbol.

Except in certain cases because back-compat is complicated.

Re: Is Perl 6 Being Renamed?

#407

Earlier quoted context omitted.

> 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.

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.

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?

#408
post #396

Earlier quoted context omitted.

How fast is your Perl11 project compared to Perl5 and Python?

Faster than both. But more importantly much better security, much more features, and continuous improvements. perl5 is just continuous destruction.

That's interesting. I've seen you make these statements, but have never been able to confirm even though I've meant to. How many actual users do you have btw?

Re: Is Perl 6 Being Renamed?

#409
post #366

Earlier quoted context omitted.

I did some tests for prime number crunching. For example the C-style loop statement is faster than Perl's own foreach. Perl6 was the slowest of them all while the fastest was LuaJIT. The whole code is two loops with a bunch of multiplications and additions, an array push, loading a hash and looking up values in it. https://news.ycombinator.com/item?id=16720027

This seems like a very odd standard to use? I understand that you wanted to compare performances of different languages, that's great. But if you actually wanted to get the job done idiomatically, the code is one short, simple line of Perl 6. The performance, while admittedly slower, is within the same order of magnitude as your Perl 5 version. To me, this is the magic of Perl 6. Sure, if you want to use 16 lines of…

That is impressive!

Re: Is Perl 6 Being Renamed?

#410
post #145
post #58

Earlier quoted context omitted.

If Perl 6 is renamed, Perl 5 could skip to Perl 7 in the next version to avoid confusion.

Yes for Perl 5->7, but it would be good to have a solid-ish feature change or addition to justify the jump and promote it. When I see that we still don't have a simple "is item 'in' set" operator, 12 (?) years after the introduction of smartmatch and 5 or 6 years after its half-retraction... (Well, we still have no sets either :-), let's talk about lists/arrays...) When I see we still don't have a clean function para…

There is little strain on the "language leaders" (that would be barking up the wrong tree, anyway) as the features you named with one exception are already done and have been available for years.

• "is item 'in' set" operator: https://metacpan.org/pod/Syntax::Feature::In

• sets: https://metacpan.org/pod/Set::Object

• clean function parameters declaration system: https://metacpan.org/pod/Kavorka::Manual::Signatures

• constants that are not functions/objects: https://metacpan.org/pod/Const::Fast

• enums that are not functions/objects: ?

• structs that are not functions/objects: pack/unpack, for explanation see https://metacpan.org/pod/Convert::Binary::C

Post reply on HN