4 ms·
Actually if you define the COBOL slang well, you can add a construct which will allow dropping back down into Perl 6 so that you can intermix both languages and
by b2gills 9y ago
Actually if you define the COBOL slang well, you can add a construct which will allow dropping back down into Perl 6 so that you can intermix both languages and use each to their strengths in the same file.
That is how the string literal and regex sub-languages work in Perl 6.
Frankly while that is a nice feature, and makes it easy to test bug fixes to the compiler using the REPL, I don't think that it is the best selling point. Mostly because it is only used by a handful of modules currently, and most users of those modules don't care how they work.
I think it is better to say that Perl 6 is a rather flat language. Once you learn a feature, you can use it everywhere. For example there are languages that have special syntax for use in list slicing, whereas it isn't special in Perl 6. (instead you can use a lambda to do more complex slicing)
What this means is if you see a construct that you've already seen, but it is used in a place you didn't think it would work, you can pretty much guess immediately how it works. For example an <code>if</code> block can be parameterized using the exact same syntax as parameterizing the block of a <code>for</code> loop. Which is useful so that you don't have to create a temporary variable, or call the same method twice. (It isn't all that useful when using the comparison operators which only return True or False though)
The most oft heard complaint among people who are adept at Perl 6, is about having to go back to another language. I think the main reason for this is Perl 6 bends to your will, and other languages bend you to it's will.