|
|
|
|
|
by Ulti
3510 days ago
|
|
A) It's released with a frozen spec and a large test suite for compliance (https://github.com/perl6/roast), with a compiler available that supports a module ecosystem with over 700 modules (http://modules.perl6.org). What's a complete state in your mind? If not this. B) All of the below is core language, not a use or import anywhere required. Error reporting is also handled for you without autodie and friends. Reading from a file:
#Efficiently line by line for STDIN
for lines() -> $line {
$line.say;
}
#Get everything in RAM right now
my $string = "filename".IO.slurp;
#Lazy list will do IO as you request into the list
my @lines = "filename".IO.lines;
#Listing of directories if the path is a directory
my @directories = "coolstuff".IO.dir if "coolstuff".IO.d;
Playing with dates:
#Get a DateTime for right now
my $date = DateTime.now;
#Does what it says on the tin
say "Yippee" if $date.later(:5years).is-leap-year;
|
|
B) Nice examples. Well done. But it's not about whether you can do the simple things. It's more about the impression of the community and where its interest and focus lies.
I'd rather use a language where the mundane day-to-day stuff is the most important consideration. My impression of Perl6, however unfair that may be, is that the day-to-day functionality is the boring necessary evil that must be in there somewhere, but the true focus is the amazing stuff you can do with a language that's simultaneously trying to be a better Perl, and a better Lisp, and a better Erlang, and a better Haskell.
In my mind, Perl6 is a huge lumbering beast that tries to do absolutely everything. I'm sure if I ever feel the need to write a lazy asynchronous parser script, it'll be the first language that leaps to mind. In the meantime, I don't have the time nor the interest to bother.