Earlier quoted context omitted.
Sigils have been standard in shells for decades. And sigils allow string interpolation to work; again, just like in normal unix shells. The python people decided that sigils are a bad idea, so instead of being able to say "I have $n apples" (like you could in shells we've all been using forever!) I now need to say "I have {} apples".format(n). I know which one I prefer!
Javascript has `I have ${n} apples`, or even `This is chapter ${i+1}.` In terms of interpolation, that's the variant that I like best.
Haskell to Perl 6
41–50 of 136 posts
Re: Haskell to Perl 6
#42Perl 6 is for people who are very smart and have a great spirit in seeking and having fun in programming, I really admire that. That's my thought after two failed attempts (each lasted about two days) to learn it in 2012 and 2014. I felt the use of sigils, syntax oddities and the cleverness were beyond my ability to master the language. I should mention in 1998 I used (modified it a little bit) Selena Sol's shopping…
Not sure why you felt the need to include this. How did you come to this conclusion? Is this in comparison to Haskell, or what?
Re: Haskell to Perl 6
#43Perl 6 is for people who are very smart and have a great spirit in seeking and having fun in programming, I really admire that. That's my thought after two failed attempts (each lasted about two days) to learn it in 2012 and 2014. I felt the use of sigils, syntax oddities and the cleverness were beyond my ability to master the language. I should mention in 1998 I used (modified it a little bit) Selena Sol's shopping…
> Perl 6 is for people who are very smart and have a great spirit in seeking and having fun in programming Not sure why you felt the need to include this. How did you come to this conclusion? Is this in comparison to Haskell, or what?
Re: Haskell to Perl 6
#44Not to be trollish, but is anyone actually using Perl 6 for more than just for kicks? It is a super interesting language, but has it been battle tested over the years similar to Perl 5?
Re: Haskell to Perl 6
#45Earlier 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…
for number in numbers:
if number
Do you have a better example where the Perl syntax would shine?Re: Haskell to Perl 6
#46Not to be trollish, but is anyone actually using Perl 6 for more than just for kicks? It is a super interesting language, but has it been battle tested over the years similar to Perl 5?
Perl 6 is still 9 times slower than Perl 5 when parsing log files with a regex. I don't quite get why the feature which made Perl famous has now taken a back seat. Why should I take a 9x performance hit?
Re: Haskell to Perl 6
#47Earlier quoted context omitted.
Perl 6 is still 9 times slower than Perl 5 when parsing log files with a regex. I don't quite get why the feature which made Perl famous has now taken a back seat. Why should I take a 9x performance hit?
The Perl 5 core is hack upon hack, to the point that it's been mostly abandoned due to how hard is to change things without breaking anything. Perl 6 was born as a specification, which allows for a "first make it right, then make it fast" approach.
Re: Haskell to Perl 6
#48What’s the objective or rationale here? I don’t understand why this is interesting.
Re: Haskell to Perl 6
#49There's also a Python version of this[1], which starts with a discussion about Perl 6's equivalent of print, which is put. This makes no sense to me whatsoever, as print is both a much easier way to say it and _what was used in Perl 5_, but not my circus, not my monkeys. But then it goes on to say: > There is also say, which behaves similarly, but will call the gist method of its argument. And after having read the l…
put/say are output functions which automatically add a newline at the end.
If you want fancier formatting, printf is available as well.
And notice the relative lengths of these names. As much as possible, p6 is organized so that the more commonly used thing will have the shorter name.
PS I don't think I have ever used put in p6. My code uses say, or print if I don't want a newline added to the output.
Re: Haskell to Perl 6
#50Earlier quoted context omitted.
> Perl 6 is for people who are very smart and have a great spirit in seeking and having fun in programming Not sure why you felt the need to include this. How did you come to this conclusion? Is this in comparison to Haskell, or what?
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.