4 ms·
Perl 6 supports all kinds of paradigms, this makes it so that you don't have to write parts of the code in different languages and try to cobble them together.
by b2gills 7y ago
Perl 6 supports all kinds of paradigms, this makes it so that you don't have to write parts of the code in different languages and try to cobble them together.
So the code can be written using the clearest paradigm for the task at hand without switching languages.
---
The only real bad parts of Perl6 that I can see, is the parts that are copied from elsewhere largely unmodified.
The C-style `for` loop is one such example.
loop ( my int $a = 0 ; $a < 10 ; ++$a ) {
print("hi\n");
}
Why would anyone write that when they could write this instead:
print("hi\n") xx 10;
Where there isn't a chance for an off-by-one error, or accidently creating an infinite loop.
You can still use it to intentionally create an infinite loop:
my @a = rand xx ∞; # a lazy infinite array of random floating point numbers.
---
After someone would write a “the good parts” book, the next major version of the language would probably fix many if not all of the not-so-good parts.
If there is a feature that isn't one of “the good parts”, we'll just change it until it is.
That's one of the great features of being an easily mutable language, you can mutate it into a better language.
(It already has mutated in some small ways.)
---
Perl6 doesn't have too many paradigms, if anything it has too few. I would love if it had support for implicit auto currying like Haskell does. (Instead I have to settle for explicit currying.)