Slashdot Mirror


Perl's Extreme Makeover

PurdueGraphicsMan writes "There's an article over at Yahoo! about the upcoming version of Perl (version 6) and some of the new features (RFC list). From the article: "Although Perl 5's expressions are the most sophisticated available and aspired to by other programming languages, "no one pretends for a moment that they're anything but hideously ugly," said Damian Conway, a core Perl developer and associate professor at Monash University in Australia.""

16 of 408 comments (clear)

  1. From the horse's mouth by ChaosDiscord · · Score: 5, Informative

    If you want the real scoop on the on-going planning of Perl 6, you might want to check out Larry Wall's Apocalypse articles: 1, 2, 3, 4, 5, 6. On the down side, they are dense. Very dense. For that reason, I actually recommend Daimon Conway's Exegesis articles: 2, 3, 4, 5, 6. They provide alot more context on what the changes actually mean to you and why they're good.

  2. Re:Anyone who intimately knows 5 by psycho_tinman · · Score: 5, Informative

    I cannot claim to intimately know Perl 5, but I started learning it a few years back. I belong to the camp of Perl programmers (and I know there are a few of these) who are adopting a "wait and see" attitude to Perl 6.

    If you're interested in learning Perl now, you should probably go for the cookbook approach, ie: get a copy of OReilly's Perl cookbook and just try applying the solution to your problem. Then, trying tweaking and figuring out how it works.

    As for learning Perl 5, I'd probably point out that there are still some places that run 5.005_03 (certainly Solaris used to ship with that version by default), and that version is at LEAST 5-6 years old :) There are even some places I've heard of that run Perl 4 :) So, I think there is plenty of time to have your investment in learning Perl pay off before people start switching to Perl 6 en masse.

  3. Re:Anyone who intimately knows 5 by Telastyn · · Score: 5, Informative

    Personally, I found that perl was kind of odd and not fantastic until I learned perl with regexes [via O'Reilly's Mastering Regular Expressions, highly recommended]. Then alot of the little nuances made alot more sense. Alot of the examples in that book were things perl does easily in a few lines, but would cause most programmers to gouge their eyes out if they needed to do it in C.

  4. Re:Ruby... by Tyler+Eaves · · Score: 4, Informative

    You mean like:

    Doc

    http://www.ruby-doc.org/

    http://www.rubycentral.com/book/

    Unit Testing

    http://testunit.talbott.ws/

    http://www.rubygarden.org/ruby?RubyUnit

    Library Repository

    http://raa.ruby-lang.org/

    Portability
    Source compiles on anything vaugely Unix like

    Windows binaries available

    User Community
    comp.lang.ruby

    So, what were you on about again?

    --
    TODO: Something witty here...
  5. "Initial construction of the Internet" by Repton · · Score: 4, Informative
    Perl, a high-level programming language that was critical in the initial construction of the Internet, ...

    Perl was first released in 1987. Y'know, I could've sworn the internet already existed back then...

    (especially since Perl was released in a post to alt.sources)

    --
    Repton.
    They say that only an experienced wizard can do the tengu shuffle.
  6. Re:Trolling, maybe by rgmoore · · Score: 5, Informative

    You might be interested in Ponie, then. Ponie is the project to create a Perl5 interpreter for Parrot. It should let you get much of the speed benefit of the new virtual machine without having to learn the new Perl6 syntax. Of course you may still want to learn the new syntax, since it will add many powerful new features, but Ponie will ensure that Perl5- and all of the work you've put into your Perl5 scripts- won't be completely abandoned just because Perl6 has come out.

    --

    There's no point in questioning authority if you aren't going to listen to the answers.

  7. Re:Anyone who intimately knows 5 by cliveholloway · · Score: 3, Informative

    Start now. It's gonna be a while before six is out - and even longer before companies will trust it in production environments.

    And come over to The Monastery to get help when needed. A great resource for new (and experienced!) Perl hackers.

    .02

    cLive ;-)

    --
    -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism
  8. for the naysayers.. by psycho_tinman · · Score: 5, Informative

    A few points to ponder ..

    You've all heard the "you can write unreadable code in any programming language" argument, so I'll spare you the repetition.. (No, wait.. I didn't, did I? ) *grin*

    But also bear in mind that Perl is the first language that I know of that used the foreach construct in the same form as the more sought after languages.. Java has iterators and enumerators, but they introduced a foreach because it is darn easy to understand.

    Perl innovated in regular expressions. Even Jeffery Friedl's Mastering Regex (sic) says that other languages aspire to be called "Perl 5 compatible" when they don't necessarily support all the features of Perl 5.6". Love it or hate it, regular expressions are like the microwave in your kitchen. Once you get used to it, it's darn hard to manage without :)

    I am not going to go into Perl 6 the moment it is released. But I guess that's ok, because I didn't adopt 5.8 the day it was released either. I just think that Larry Wall has made enough good calls in the language so far, to be worth trusting him for another version. Even one that promises to break some of the idioms that I am accustomed to in it's present incarnation. Hey, I didn't like Perl 5 when I first saw it either, but I notice the difference in my productivity when I got the hang of things.

  9. Re:The Parrot Vaporware Engine? by J-Worthington · · Score: 4, Informative

    I have a small involvement with Parrot (e.g. I've contributed a few small, insignificant things, mainly fixes for Win32). It's not vaporware, it's just that designing a stable, efficient, multi-threaded virtual machine that runs on a wide range of different platforms isn't an easy task. You can go and do a CVS checkout of Parrot now and play with some of the toy compilers, or if you use Windows grab yourself the Parrot On Win32 compiled version:-
    http://www.jwcs.net/developers/perl/pow /

    The 0.1 release may be coming by the end of this month - and if this release isn't 0.1, I'm pretty sure the next one will be. That means Parrot has objects, some of the threading stuff is in place, JIT is working on various platforms and more. There's a lot of hard work going in by a lot of very good developers (not me!), and I'm confident that Parrot will be completed and will be a hot target for dynamic languages.

  10. Re:Perl... by vt0asta · · Score: 4, Informative

    No, I mean like:

    Doc

    Something a little more thorough.

    http://www.perldoc.com/

    Unit Testing

    Not just wrappers, but something a little more thorough and mature like say from executable to module.

    Unit Testing

    Library Repository

    http://raa.ruby-lang.org/
    ..pales in comparison to...

    http://www.cpan.org/

    Portability

    [Acorn] [AIX] [Amiga] [Apple] [Atari] [AtheOS] [BeOS] [BSD] [BSD/OS] [Coherent] [Compaq] [Concurrent] [Cygwin] [DG/UX] [Digital] [DEC OSF/1] [Digital UNIX] [DYNIX/ptx] [EMC] [Embedix] [EPOC] [FreeBSD] [Fujitsu-Siemens] [Guardian] [HP] [HP-UX] [IBM] [IRIX] [Japanese] [JPerl] [Linux] [LynxOS] [Macintosh] [Mac OS] [Mac OS X] [MachTen] [Minix] [MinGW] [MiNT] [MPE/iX] [MS-DOS] [MVS] [NetBSD] [NetWare] [NEWS-OS] [NextStep] [Novell] [NonStop] [NonStop-UX] [OpenBSD] [ODT] [OpenVMS] [Open UNIX] [OS/2] [OS/390] [OS/400] [OSF/1] [OSR] [Plan 9] [Pocket PC] [PowerMAX] [Psion] [QNX] [Reliant UNIX] [RISCOS] [SCO] [Sequent] [SGI] [Sharp] [Siemens] [SINIX] [Solaris] [SONY] [Sun] [Symbian] [Stratus] [Tandem] [Tru64] [Ultrix] [UNIX] [U/WIN] [Unixware] [VMS] [VOS] [Win32] [WinCE] [Windows 3.1] [Windows 95/98/Me/NT/2000/XP] [z/OS]

    User Community

    A little more world wide and established.

    http://www.pm.org/ ...in addition to the mailing lists.

    So, what were you on about again?

    From the parent parent parent poster. "Ruby has almost all of the power of Perl, with none of the ugliness" isn't quite a fair statement, considering Ruby is lacking or behind on almost everything else Perl is superior at. Ruby is still playing catch up, and depending on who you ask, can also be considered ugly.

    --
    No.
  11. Parrot by steveha · · Score: 4, Informative
    I was intrigued by the news of Parrot, the interpreter core. It's a virtual machine, register-based rather than primarily stack-based as some other virtual machine cores have been. This is to take advantage of compiler technology.

    Long-term, Parrot hopes to be at the core of not just Perl 6, but also Python, FORTH, and what-have-you. Then applications could support Parrot, and users could script the applications in their favorite language. Python users could call into Perl CPAN code. That sort of fun thing.

    Parrot's home page is: http://www.parrotcode.org/

    The Parrot FAQ is worth reading. There are some really entertaining sections. One of my favorites:
    Why should I program in Parrot Assembly language?
    [...]
    You get all the pleasure of programming in assembly language without any of the requisite system crashes.


    Another:
    What language is Parrot written in?

    C.

    For the love of God, man, why?!?!?!?

    Because it's the best we've got.

    That's sad.

    So true. Regardless, C's available pretty much everywhere.


    So, my next question was: if they want to become the core of languages like Python, what does Guido van Rossum (the architect of Python) have to say about that? A few google searches later, and I found an interview at linuxfr.org, which contained this:
    DLFP: What do you think of the Parrot project (http://www.parrotcode.org/), which aim is to develop a common virtual machine for interpreted languages, such as Perl 6, Python, Ruby and Tcl ? [Jean-michel Fayard]

    Guido: I wish them well, but I don't think they will succeed. They are vastly underestimating the effort that goes into a virtual machine for any specific programming language. Even languages as similar as Ruby and Python have fundamentally different runtime abstractions, and the difference between Python and Perl is much greater still. (For example, the concepts of strings and numbers are entirely different in these two languages: in Python, numbers and strings are different immutable types, while in Perl they are the same type and are mutable.) I expect Parrot will do a great job of running Perl 6, but a relatively poor job of running other languages. Of course, I'd be happy if I were wrong (except for the brief moment of receiving a pie in the face at OSCON 2004), but I don't expect that to happen.

    steveha
    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
  12. Re:Quite possibly very naive question from a non-p by J-Worthington · · Score: 4, Informative

    Parrot will be a virtual machine like the JVM and .NET runtime, yes. This means you can call functions and use objects from code written in the various different languages that target Parrot, compile stuff to bytecode that will run wherever Parrot will compile and more. Like .NET and JVM it uses JIT techniques to provide fast code execution.

    The main difference between Parrot and .NET/JVM is that they are more targetted towards statically typed languages. Languages like Perl, Python, etc that are likely to target Parrot are dynamic languages. This isn't just related to dynamic typing, but also to dynamic languages needing their parsers to be available at runtime. You can also do more stuff at runtime that non-dynamic languages would prefer you didn't. Parrot is designed with this in mind, which means it can offer these sorts of languages better performance.

    I have heard things along the lines of JVM and .NET bytecode to Parrot bytecode convertors, but I'm not sure how much speculation that is. I'm not really certain how easy it'd be, though my initial guess is "not very".

    Hope this answers some of your questions.

  13. Re:Too many cooks by kinsoa · · Score: 3, Informative

    there *is* a full backward compatibility : Parrot will run your Perl5 code. And if you don't want to run old perl5 code, there will be a script to convert your code.

    and you don't have to care about migration for now - not until the next two years. Perl6 is not ready.

    the "lunatics", as you said, seem to be very serious and competant...

  14. Python Resources. by Anonymous Coward · · Score: 3, Informative
    This is a list of what I consider to be the most useful Python packages. They give Python the ability to tackle almost any project.
    • Python - Get the Python interpreter, base libraries from here. The default install includes the IDLE editor.
    • Win32All - Windows extensions package that includes the excellent Pythonwin editor.
    • wxPython - Wrapper to the cross-platform wxWindows window manager library. It's a better windowing system than the TCL/TK library that is the default Python install.
    • Boa Constructor - GUI builder that uses the wxWindows library.
    • Psyco - x86 runtime compiler. Transparently improves the performance of most Python code - for performance-critical apps, it's often a much better solution than a C rewrite.
    • Py2Exe - Builds Python scripts into Windows executables. Perfect for distributing programs to systems that do not have Python installed. Use with Psyco for the best effect.
    • PyOpenGL - Use OpenGL from within Python
    • Python Image Library (PIL) - Package for easy image loading and manipulation
    • Plone - Web applications, built on top of the Zope framework.

    Abandon Perl! Python is the future!
  15. Re:Whew, backasswards compat-with Perl 5 by ikewillis · · Score: 4, Informative
    Not only is it backwards compatible, but thanks to Perl 6's new modular architecture, Perl 5 code will simply include a separate parser/compiler which will generate code which will execute through the Parrot runtime, which adds a number of optimization benefits (at runtime, even) not currently possible through the current Perl 5 compiler/parser/runtime mush.

    Consequently, Perl 5 code should run faster under Perl 6.

  16. or you could just use the x modifier by cliveholloway · · Score: 4, Informative
    s/\s+ # at least one space<br>
    \( # open parenthesis<br>
    .*? # as few characters as possible<br>
    \) # close parenthesis<br>
    //gx; # perform on every line and allow comments in regex

    lameness filter won't let me space the comments neatly, but I'm sure you get the idea.

    .02

    cLive ;-)

    --
    -- Trinity in high heels carrying a whip: The donimatrix - there is no spoonerism