Slashdot Mirror


Larry Wall On Perl 6, Language Design, and Getting Kids To Code

M-Saunders writes: Perl 6 has been a long time in the making, but Larry Wall, the language's chief developer, now says it should arrive in time for Christmas. In this interview with Linux Voice, Wall explains why Perl 6 took so long, and describes how his background in linguistics influenced the design of the language. He also discusses ways to get kids interested in coding, and notes that Python has done a better job so far in this respect.

8 of 133 comments (clear)

  1. To teach kids to code you need an incentive by Wycliffe · · Score: 5, Insightful

    Growing up in the early 80s on an apple II, one of the things that helped me learn to code was that I could edit and modify existing code like Oregon Trail to cheat. It also helped that there was a limited amount of other things. We didn't have 24 hour kid cable channels so once I got bored then I needed something else to do. I see the same things in my kids. They love kodable on the ipad because it gives them a new character every time they completed a level. A similiar game cargobot they aren't interested in at all because it doesn't have any rewards. I also notice that when they are grounded from their playstation is when they immediately start reading more books, playing the piano more, exploring new apps on my ipad, going outside more, etc... Just like adults, kids are going to gravitate towards what is most enjoyable at the moment and unlike adults they have very little concept of delayed gratification so doing something for their future self is not on their radar. The best way to get kids to want to code is give them something they can do with it whether it is control a robot, create a webpage to show off to their friends, etc... When I was in school alot of kids knew basic javascript and html because that was the only way to have a geocity webpage. Facebook and the likes have allowed kids to have a presence on the web without any need to code. It's still possible to get kids interested in coding if you can show them "cool to them" stuff they can do with it.

  2. "notes that Python has done a better job" by Viol8 · · Score: 4, Insightful

    Yeah , wonder why. Could it be because its actually readable and has a sane syntax that doesn't look like the aftermarth of an explosion in a punctuation factory?

  3. Re:Perl is better than you think by NoNonAlphaCharsHere · · Score: 3, Insightful

    Perl code can be treacherously obfuscated, but that's part of the fun. As long as good code is well documented, there is no harm.

    To quote something I read somewhere:

    You have obviously never coded in any language, let alone Perl. Comments like these are usually from people with zero real life experience.

  4. Re:Perfect summary of Perl from Larry himself by swb · · Score: 4, Insightful

    Disclaimer: My longest Perl programs were around 500 lines, designed mostly to process log files and provide some kind of selectable reporting capabilities.

    Is this a function of Perl itself or a function of the people writing code adopting poor coding and commenting practices? Just because the language lets you use weird shortcuts to compact several atomic steps into one line, should you?

    In my case, the scripts were dependent on the log files being in a specific format for parsing and analysis. A couple of times over the five year time I used them the vendor changed the log format, requiring me to modify the parsing and in one case make some non-trivial changes to a reporting summary due to differences in the log format.

    I never had a problem going back to the script 18 months or so since the last time I edited it and understanding what I did or how I did it, thanks to generous comments and avoiding the kind of obfuscation Perl let you -- but doesn't require you -- to do.

    I'm not a coder by trade and I thought Perl was very easy to learn. My sense is the complaints about Perl code are more a function of a language that's easy to learn and is thus adopted by a lot of amateur coders who then churn out a lot of code that they think is "made better" by some of Perl's shortcuts. I think it was one of those things where the user culture was such that the "smart guys" in the forums an newsgroups wrote obfuscated code and since they're elite, well, maybe I should to because it just might trim .025 seconds of execution time or something.

    More complex languages are adopted by people with more discipline and experience and they just naturally impose more discipline on their coding style.

  5. Perl is Perl. by fyngyrz · · Score: 4, Insightful

    Try running Python 3 in a Python 2 environment

    Why... would you do that? Python 3 is not a new version of Python 2. Python 3 is "other." I think you're just confused by the (admittedly very poor) naming convention they have adopted. It probably should have been called Serpent or something along those lines, because it really isn't an attempt to "be" Python 2 at all. Furthermore, if your code is tested and running, why would you convert it to Python 3 and then have to re-test? Seems to me the number of good business reasons to do such a thing would be a very small number (of course, you might want to do it for fun or educational value, but that's not really germane.) Python 3 is for new code, if you want to go that way (and you certainly don't have to.) Python 2 is solidly emplaced and not going away. It's a different thing. It's not a "you need to upgrade" thing or a "you have to move your code" thing or a "now Python is this other thing" thing. Python 2 is Python 2, Python 3 is other. That's all you need to know.

    Perl is backwards compatible with itself

    No, it isn't. For instance, later versions of Perl will choke -- the code will fail and/or act differently -- on various early usage patterns, such as hash references.

    Perl has CPAN, the likes of which don't exist in Python.

    https://docs.python.org/dev/distributing/index.html

    CPAN itself is a bunch of usable Perl. There's a huge amount of usable Python out there as well. It's disingenuous to suggest that CPAN, which is merely a repository, represents a meaningful difference.

    Better even than Python for text work and regex.

    Meh. I haven't run into any text processing problems that I couldn't solve with Python that made me think, "gee, wish I had X Perl feature." And I wrote in Perl for quite a few years, I know the territory fairly well. Python's got some pretty solid regex handling as well. Python 2. No idea what Python 3 has, could care less. Different language and all that. :)

    It's my opinion that for what Perl excels at, one can get off the ground quicker and easier in Perl than in Python

    Oh good grief no. Perl is hard to read by nature. Python is easy to read by design. Now, if you had said "for the experienced Perl programmer who knows little or nothing about Python", then sure. But otherwise, just no. Perl is horribly obscure in terms of "getting off the ground." Moving to Python from Perl was like having a huge splinter pulled out my butt for that very reason. I can actually read other people's code and understand it without having to keep in mind a whole raft of special characters and the like. Instead, what is happening is almost always spelled out fairly explicitly in what nearly amounts to plain English, requiring much, much less of my brain to be dealing with the language, and leaving much, much more of it free to be dealing with the program logic.

    I've been in IT far longer...

    Not the OP, but I've been in IT since ~1972. You may have been at it longer, but I've been at it long enough to come to the conclusion that the objective of a programming language is to solve a problem, and specifically to do it in such a way that the solution is maintainable, effective, and doesn't naturally hide bugs because of ingrained opacity. Something may come along that is better at these things than Python, but I've not run into it yet, which could certainly be a result of me not looking at things that are already out there -- but it isn't a result of not looking at Perl. I've written an enormous amount of Perl, and if there is one thing I will say about it consistently with benefit of hindsight, it is that I wish I'd been able to write it all in Python. Because Python is much, much easier to write, clearer to read later, easier to debug, easier to fix, and yes, actually more fun.

    --
    I've fallen off your lawn, and I can't get up.
    1. Re:Perl is Perl. by GargamelSpaceman · · Score: 2, Insightful

      A regexp is almost always cleaner and easier to read and understand than other code that does the same thing.

      Learn regexps. Learn to love them. Bite the bullet.

      And Perl is as readable if not moreso than many other languages. I'd rather have a rich language full of concise ways to do what you want than one that forces you to do everything the same way even if it is roundabout.

      I care more about the person that uses it every day being able to read it than someone who has never used it being able to pick it up.

      Let the wizards set the standard noobs should aspire to, not the other way around.

      Perl's real problem is that Perl has too long lacked critical features that other languages have been getting while Perl did not because of waiting for Perl 6.

      It may have been harder to do, in terms of total work, but adding the features piecemeal to Perl 5 would have at least preserved the Perl community which is now essentially gone.

      Perl 6 might as well not even be called Perl ( and might be better off not being called Perl )

      It's a new language with a new learning curve for the new features and no users.

      Perl 5 is a dead feature lacking language with few users.

      --
      ...
  6. Not a pedagogical language by JazzHarper · · Score: 3, Insightful

    I've used Perl for 20 years and still find it more productive than most other languages, but I would _never_ recommend it as a first programming language to anyone.

  7. Re:I'd be a Walmart greeter by Anonymous Coward · · Score: 2, Insightful

    There is quite a bit of hate for Perl, and I think this is because it has become one of those things where groupthink is largely to blame. i.e. if you don't hate Perl, you're not one of the cool kids.

    The sad thing is, I can't think of a better tool for processing text easily and efficiently. Not only that, but Perl is excellent for "one liners", whereas python is just a bear at that task by comparison.