Slashdot Mirror


Larry Wall on Perl 6

Nate writes "Linux Format magazine has an interview with Larry Wall, the eccentric linguist and coder behind Perl. Larry discusses some of the new Perl 6 features ready to rock the world, and if you're not planning to move from Perl 5.8, he has a few musings on that too."

1 of 265 comments (clear)

  1. What about ruby? by goombah99 · · Score: 0, Troll

    Isn't ruby the modern successor to perl and not perl 6? Why will perl 6 be better?

    I'd also like to take a pot shot at python. My feeling about python is that python is a much better programming language than perl for SOPHISTICATED programs. But in general perl is actually a more cleverly conceived langauge with far more available power. Many of the criticism people lay on perl in comparing it to python are either naive or an artifact of python's youth and thus lack of cruft. The latter is changing as python matures.

    Here's examples of what I mean by naive criticisms: Two things I think standard newbie criticism of python and perl get exactly wrong are whitespace and variable prefixes ($@%#\).

    Pythns white space it truly annoying at first. Then you begin to see why it's such a fantastic innovation. Sure every good program has a good set of indenting rules. The trouble is despite being good, they are different. It's hard to read someone elses code with precision. With python, everyone follows the exact same rules. I can easily scan any code I find and follow the scopes, even across pages on the screen. It's truly effective in practice and one of the best things about the language.

    Perl is said to rely too heavily on symbols like $,%,@ that coders think are unnessecary and dispensed with in python. Wrong. If you actually do the count you will find that python has more special gramatical signals than python! really, try counts. lets see just to name a few there's : and () and [] and {} and @ and 'r' and ',' ... anyhow when you are done you find there are more than in perl. Worse they are used ambiguously unlike in perl. For example the use of [] in perl only means an array lookup and someone reading the code can tell this. Not true in python. Likewise for () and ',' which have both passive uses as separators and active uses as gramatical modifiers. IN perl these have one meaning.

    In perl I can visually distinguish verbs and nouns (functions, commands and variables) by their clear prefix declarations.

    Part of pythons cleanlyness comes from syntactic sugar. but under the hood it's objects are implemented the same way that perl's objects are: hashes (dir dict) or pseudo-hashes(slots) are
    and part of it's cleanliness comes form missing functionality: for example: references in perl that are lacking in python. e.g.
          for $i (@e) { $i +=1 } # $i is a pointer into @e's memory
          for i in e: i = i+1 # this code does nothing at all since i is not a pointer.

    As python matures and more and more idiomatic expressions enter (like generators expressions, or list iterators) or hash methods get extended ( .get() has defaults added to it) things get complicated and less clean.

    Perl has be criticized on this account since some of it's functions canvary depending on how they are called (e.g. split), and you have to memorize the forms. but as python iterates these same inconsistencies creep into it.
    for example, some things in python produce R-values and some do not but you can't know except by memorization (.sort and .rtrim for example). Ruby solve this nicely in a perlish fashion by introducing the character ! to differentiate in-place and r-value operations.
    In python sometimes things are short circuit expressions and sometimes they are not. for example .get() with a default actually evaluates the default value if it's a function rather than short circuiting it. On the other hand the "or" function does short circuit the evaluation when the right hand term will not be used.

    So anyhow I'm not saying python is a bad language. I use it and love it. I'm saying that it gets a bad rap from people who can't think in perl. So don't flame me on that account.

    Ruby seems so clean up the complains people have about perl while preserving it's advantages over python. so why do we need perl 6?

    --
    Some drink at the fountain of knowledge. Others just gargle.