I'd like to hear opinions on how the use of sigils and the other syntax oddities like Int:D, Int:U, given, when, etc improves the codabliity/readability of Perl 6 vs other languages. The examples vs Haskell are not helping me understand. Personally I don't think the added verbosity is helping in any way.
Haskell to Perl 6
51–60 of 136 posts
Re: Haskell to Perl 6
#52I'd like to hear opinions on how the use of sigils and the other syntax oddities like Int:D, Int:U, given, when, etc improves the codabliity/readability of Perl 6 vs other languages. The examples vs Haskell are not helping me understand. Personally I don't think the added verbosity is helping in any way.
It's 100% not added verbosity in any way. Added complexity, sure, but it's a pretty straightforward application of some of the main ideas of the language, usable in the standard C-language-family way out of the box, and powerful and flexible when you understand it.
Re: Haskell to Perl 6
#53Earlier quoted context omitted.
Except the resulting code will look nothing like “the humans say it”, and instead will be a cryptic charade requiring a ton of knowledge to decipher - ending up being neither natural language nor machine code.
> Except the resulting code will look nothing like “the humans say it”, Actually, I find it maps rather directly to how a lot of people explain things. For example, "Examine each number, and as long as it's greater than 10 and odd, then pass it to the the work function." for my $number ( @numbers ) { next unless $number > 10; next unless $number % 2; work($number); } Perl generally allows you to structure your code a…
numbers.into_iter().filter(|n| n>10 && n%2!=0).for_each(work);
map work . filter ((/=0) . (`mod` 2)) . filter (>10) $ numbers
Insert tirade about how for-loops are free to do so much that they are slower-to-comprehend than specific-purpose iterator/list functions, here.Re: Haskell to Perl 6
#54Earlier quoted context omitted.
It was tongue in cheek, haha... I was only frustrated by my own inability to get the hang of Perl 6. As an old casual fan of Perl, I still want to take another shot at learning it very much.
The perl6intro website shows you the essentials of what you need and the ecosystem has matured a lot since 2014 as well as many good books being published. Laurent Rosenfield has a Think Perl6 book that you can buy in paper or read online for free. If you can already code, getting proficient in basic Perl6 is easy. Becoming a master is outside my current grasp.
One liners are fun, and life-saving. I am curious about this aspect compared to Perl 5. With Perl 6's new syntax and language features, can we still easily [ab]use one liners for fun and profit?
Re: Haskell to Perl 6
#55Earlier quoted context omitted.
Perl has never been about uniformity. Perl is a great experiment in language design, or, rather, a battery of experiments. It's the opposite of a cleanly designed language.
No, it's designed. It's just not designed the way everyone expects a computer language to be designed. It was designed by a linguist. He produced a language with some of the flexibility (and messiness) of human languages, which is completely foreign as a goal to other languages. One of the places this shows up to me is being able to say "it" (in essence). That is, we humans, when talking to each other, we say things…
Here's 'it' in lisp: https://en.wikipedia.org/wiki/Anaphoric_macro
Re: Haskell to Perl 6
#56Re: Haskell to Perl 6
#57I still can't take Perl 6 seriously with that butterfly logo. Website looks like it's from 2003 as well.
Re: Haskell to Perl 6
#58Earlier quoted context omitted.
I have no problem reading that. Sure, I dont understand it in fine technical detail (what's Mu? An implementation of Perl? A codename for Perl 6?) But I believe I understand enough of it to start using it. This specific example seems similar to the __repr__ vs __str__ thing in Python, and not very alien at all.
`Mu` is perl6's `Object` ("mu" ≈ "nothing" in chinese/japanese). cute, but alien
Re: Haskell to Perl 6
#59Re: Haskell to Perl 6
#60I still can't take Perl 6 seriously with that butterfly logo. Website looks like it's from 2003 as well.