Earlier quoted context omitted.
Better math is one good reason. Grammars are also a great feature of Perl 6.
I've never faced a problem in another modern language where math became a big problem. Even using something like numpy made never made me frustrated with, say, python's numerical types. From what I've seen perl6 makes some operations more convenient. Cool, I guess, but not a great reason to reach for perl6. Grammars are really cool, and one reason I might reach for perl6, but you also have really great special-purpos…
Why I’m Learning Perl 6
351–360 of 380 posts
Re: Why I’m Learning Perl 6
#352Earlier quoted context omitted.
I've never faced a problem in another modern language where math became a big problem. Even using something like numpy made never made me frustrated with, say, python's numerical types. From what I've seen perl6 makes some operations more convenient. Cool, I guess, but not a great reason to reach for perl6. Grammars are really cool, and one reason I might reach for perl6, but you also have really great special-purpos…
I should have been more specific. Try this in Ruby, Python, PHP or Javascript: 0.1 + 0.2 - 0.3 . You'll get an approximation in most languages but only Perl 6 returns 0.
Re: Why I’m Learning Perl 6
#353Earlier quoted context omitted.
Ah, I figured that part was slightly off (since I knew PBC was bytecode and thus my waffling with "bytecode syntaxes"), but really didn't want to research the history I had already forgotten. Thanks for the correction. > Besides PIR, other languages still close to the metal were NQP versions (though I don't remember the exact relationship between NQP/NQP-rx/parrot-nqp) and eventually Winxed. I vaguely remember NQP/NQ…
Winxed was NotFound's brainchild, though I believe Whiteknight did push its usage. The way I remember it, the issue was that later versions of NQP moved towards greater backend independence and no longer mapped directly to Parrot VM semantics (eg 6model), so Parrot had to rely on older NQP version, making Winxed an attractive alternative.
The first relevant version of compiler tools were called PGE/TGE, written in PIR and based on the notion of attribute grammars and grammar engines. The first versions of NQP grew out of those.
I believe early versions of NQP were hosted in the Parrot repo, but they started to be developed out of tree and eventually were completely hosted out of the tree.
NQP was an improvement over PGE/TGE in many ways, so some of Parrot's internal tools were created in or ported to NQP.
Eventually (I believe with NQP-rx), NQP forked into an incompatible version out of tree. As you mention, when the next incompatible revision of NQP was being planned, it was no longer an attractive target for Parrot, because it was:
* developed out of tree
* developed out of Parrot's release cycle
* backwards incompatible
* "backend independent"
In particular, migrating existing, working Parrot tools to a new language which offered little beyond busywork to gain "backend independence" wasn't worth the effort. (Having NQP go unsupported for existing tools wasn't great either, especially given that one explanation for "backend independence" was that Parrot tools weren't evolving fast enough to support Rakudo features -- still feels like a circular argument.)I still maintain that it made little sense for Parrot to depend on an external project, evolving rapidly, offering little stability, with the express intent to obviate Parrot.
Re: Why I’m Learning Perl 6
#354Earlier quoted context omitted.
I've never faced a problem in another modern language where math became a big problem. Even using something like numpy made never made me frustrated with, say, python's numerical types. From what I've seen perl6 makes some operations more convenient. Cool, I guess, but not a great reason to reach for perl6. Grammars are really cool, and one reason I might reach for perl6, but you also have really great special-purpos…
I should have been more specific. Try this in Ruby, Python, PHP or Javascript: 0.1 + 0.2 - 0.3 . You'll get an approximation in most languages but only Perl 6 returns 0.
What I am saying is that I have not encountered a real-life case where this would have made my life easier.
Again, it's neat, but not a real reason to move to a new language.
Re: Why I’m Learning Perl 6
#355Read the article, very informative. Pleasantly surprised to find out that it doesn't mention at all language traits like syntax, but focuses on the features of Perl6's underlying VM, specifically MoarVM.
Re: Why I’m Learning Perl 6
#356Earlier quoted context omitted.
I should have been more specific. Try this in Ruby, Python, PHP or Javascript: 0.1 + 0.2 - 0.3 . You'll get an approximation in most languages but only Perl 6 returns 0.
Yes, I understand the example. It's a classic floating point numbers demonstration. What I am saying is that I have not encountered a real-life case where this would have made my life easier. Again, it's neat, but not a real reason to move to a new language.
Re: Why I’m Learning Perl 6
#357Earlier quoted context omitted.
> 10 different ways of doing the same thing Mostly an urban myth. Where it isn't, at least 8 of those ways are actually important. Exercise: write a python program that prints Python's quoting documentation, without external files, without editing the documentation. Spoiler alert: it's impossible.
So, how exactly these different ways of getting sub arguments are useful? sub add1 { my ($arg1, $arg2) = @_; $arg1 + $arg2; } sub add2 { my $arg1 = shift; # possibly two screens of dense code here, then my $arg2 = shift; $arg1 + $arg2; } sub add3 { $_[0] + $_[1] } # There may be some other ways to extract arguments # that I am not aware of. # It's possible to combine any of the methods! And this is just argument acce…
Re: Why I’m Learning Perl 6
#358Perl 6 carries 2 pieces of baggage from its predecessor - prefixing variables with "my" to create lexical scope and the obligatory "use v6;" at the top of every script. Why can't an advanced language like Perl 6 scope variables without littering "my" everywhere? You don't see it in any other mainstream language I can think of.
Re: Why I’m Learning Perl 6
#359Earlier quoted context omitted.
> 10 different ways of doing the same thing Mostly an urban myth. Where it isn't, at least 8 of those ways are actually important. Exercise: write a python program that prints Python's quoting documentation, without external files, without editing the documentation. Spoiler alert: it's impossible.
I'm not sure I understand your exercise. What do you mean by "Python's quoting documentation", and what do you mean by "editing" it?
String literals are described by the following lexical definitions:
stringliteral: shortstring | longstring
shortstring: "'" shortstringitem* "'" | '"' shortstringitem* '"'
longstring: "'''" longstringitem* "'''" | '"""' longstringitem* '"""'
shortstringitem: shortstringchar | escapeseq
longstringitem: longstringchar | escapeseq
shortstringchar:
longstringchar:
escapeseq: "\"
You can't paste that text into a file and write a Python program around it that outputs the same text. You need to encode the quote characters.More generally, there is no way in (many languages including) Python to treat an arbitrary (yet known) block of data as data.
Re: Why I’m Learning Perl 6
#360Earlier quoted context omitted.
I'm not sure I understand your exercise. What do you mean by "Python's quoting documentation", and what do you mean by "editing" it?
I was wondering about that, too. Unless `"Python's quoting documentation"` is an easter-egg in "help()" that recursively contains a quoted version of itself, it should be possible to just escape all problematic characters. But maybe that counts as `"editing"`? Not sure.
how would it not