|No such thing as a small change|
Re^4: Perl 6 <-> Perl 5 bridges (was Re^2: Capturing parenthesis and grouping square brackets)by raiph (Friar)
|on Jun 28, 2013 at 02:23 UTC||Need Help??|
No the result is not more friendly
Perhaps you did not understand that my "more friendly" comment was about P5ers learning P6 versus learning lisp, haskell or scala. Or perhaps I just need to be more concrete.
Consider a dissatisfied or adventurous P5er who is considering learning lisp or haskell to better solve a problem or advance their skills or career. To facilitate comparison, here's a simple example task, the Same Fringe task on Rosettacode:
Write a routine that will compare the leaves ("fringe") of two binary trees to determine whether they are the same list of leaves when visited left-to-right ... an elegant solution is one that can perform the minimum amount of work to falsify the equivalence of the fringes when they differ somewhere in the middle, short-circuiting the unnecessary additional traversals and comparisons.
Rosettacode solutions in lisp (racket), haskell, and Perl 6:
The P6 solution invisibly incorporates lazy processing (stolen from haskell) and parallel processing (the all "junction") and visibly incorporates multi subs (stolen from lisp).
Of the three solutions, I think the P6 one will look by far the most approachable and be by far the easiest to explain to an average P5er.
The P6 design takes in to account bridging to P5 in many more ways than just providing more syntactic and semantic continuity than most non-Perl langs (imo). For example, it supports inline mixing of langs (and does so with way more underlying cleanliness and power than P5's equivalents):
I agree that there are heavy downsides to mixing langs like this. I don't agree that those downsides are so great that it never makes sense to mix langs inline, even ones that are closely related. YMMV.