Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Perl Programming IT Technology

Perl 6: Apocalypse 6 Released 247

data64 writes "The latest Apocalypse talks about subroutines. Looks like we finally get type signatures which are way more powerful than the rudimentary prototypes available with Perl5."
This discussion has been archived. No new comments can be posted.

Perl 6: Apocalypse 6 Released

Comments Filter:
  • More Information (Score:3, Informative)

    by Anonymous Coward on Monday March 10, 2003 @06:15PM (#5480264)

    The Previous Apocolypses [perl.org] as well as some more info (who's who, list summaries). Read up!

    On another note, is Perl 6 even going to be relevant with next-generation languages like Ruby and Python already fairly mature? ;-)

  • Mirror (Score:1, Informative)

    by zachlipton ( 448206 ) on Monday March 10, 2003 @06:16PM (#5480276)
    It wouldn't be slashdot without a mirror:

    http://www.zachlipton.com/apocalypse6.html [zachlipton.com]

  • Re:20-odd pages... (Score:2, Informative)

    by data64 ( 300466 ) on Monday March 10, 2003 @06:16PM (#5480278)

    So long as we get a foreach() mechanism with in-built index into the array it's looping over, I'll be happy. That's my biggest problem at the moment.

    You mean something like:

    foreach my $elem (@list ) {
    print "$elem\n"
    }

    This works in Perl5.

  • Re:20-odd pages... (Score:2, Informative)

    by wirelessbuzzers ( 552513 ) on Monday March 10, 2003 @06:22PM (#5480326)
    No. He means he wants to:
    foreach my $elem (@list) {
    do something with $elem;
    do something with the index of $elem;
    }
    Right now, that looks like:
    foreach my $index (0..$#list) {
    $elem = $list[$index];
    do something with $elem;
    do something with $indexd;
    }
  • Re:Perl, the new ADA (Score:2, Informative)

    by TimToady ( 52230 ) on Monday March 10, 2003 @06:36PM (#5480418)
    The entire syntax is redefinable, including removing will if you hate it.
  • by Wee ( 17189 ) on Monday March 10, 2003 @06:50PM (#5480520)
    Perhaps they should have kept Perl 5 as /usr/bin/perl5 and make sure that it stays static for all eternity.

    Here's your solution:

    [siewsk@hostname siewsk]$ tar zxvf perl-5.0.0.4.tar.gz; cd perl-5.0.0.4; rm -f config.sh Policy.sh
    [siewsk@hostname siewsk]$ /bin/sh Configure --prefix=/usr/bin/perl5.0.0.4
    [siewsk@hostname siewsk]$ make; make test
    [siewsk@hostname siewsk]$ sudo make install
    [siewsk@hostname siewsk]$ sudo ln -s /usr/bin/perl5.0.0.4/bin/perl /usr/bin/perl5

    You now have /usr/bin/perl5 forever and ever, as long as you use #!/usr/bin/perl5 at the top of your scripts.

    -B

  • by Ars-Fartsica ( 166957 ) on Monday March 10, 2003 @06:58PM (#5480574)
    perldoc -f $FUNC

    Does php provide anything like this?

    What I typically hear and feel myself is that the php site documentation is sparse to a fault, with a great deal of useful information simply left out. Check out how many holes are filled in by contributors at the bottom of each page of the php.net site docs. These are glaring ommissions.

  • by mcc ( 14761 ) <amcclure@purdue.edu> on Monday March 10, 2003 @07:03PM (#5480632) Homepage
    I dont see the inherent advantage in desinging a language thats hard to read.

    This is what's great about perl 6. Yes, it has so many insane features and rediculous complex rules and bizarre exceptions to its rules that when reading code with someone else's programming style, you may as well be reading a different programming language (Quick! What's the difference between "sub foo will do { something() }" and " { something() } " ?).

    But the real strength in perl 6 is that it's just about infinitely configurable. You can redefine the grammar to fit your needs or whims. This is going, naturally, to cause 17 year olds who load their grammars up so much with wierd macros that their programs will become literal line noise that ceases to function if you change one character, but it will also mean that in the "enterprise", you can be completely shielded from the messiness. All it takes is defining a specialized version of "use strict" that reduces the language down to what you need, and suddenly perl 6 is some very simple, simple, easy to understand language. As long as the speed's OK, people enforce standardized coding within an organization and the default -w is really careful to warn you if you say { 1, 2, 3 => "a" } and it looks like what you probably meant was hash { 1, 2, 3 => "a" } , i don't see it being a real problem. And from a compatibility stndpoint, having one language with EVERYTHING and the ability to cut out what you don't need in wide swaths is way better than recurring situations where people go "well.. i want to use java, but i need feature X" and wind up using some funky third-party jvm compiler that produces huge executables and requires funky tricks to incorporate into my build cycle."

    Perl 6 is as hairy as you want it to be, and no more.

    Perl 6 is going to be the bestest second system ever! ^_^
  • by antis0c ( 133550 ) on Monday March 10, 2003 @07:18PM (#5480774)
    You obviously aren't aware of exactly what Perl 6 is. It's more than just a language, it's a whole runtime environment similar to .NET or Java. When Perl 6 comes out you can continue to use your Perl 5 scripts with it, or write scripts in Pascal, or in C, or in Java, or in BrainFuck. The compiler and runtime are completely separated.
  • Re:20-odd pages... (Score:3, Informative)

    by tramm ( 16077 ) <hudson@swcp.com> on Monday March 10, 2003 @07:42PM (#5480937) Homepage
    albalbo wrote:
    foreach (@list) { $list[$i] = 'No jam today!' if ($_ =~ /jam/); }
    While I understand your desire for the array index in question, it is not necessary in your example. $_ is an alias to the current list element and is writable. You can do your example as:
    foreach( @list ) { $_ = 'No jam today!' if /jam/ }
    You're correct that tracking the index on your own will be confusing due to last, next, redo, etc.
  • Re:Perl obit? (Score:2, Informative)

    by erikdotla ( 609033 ) on Monday March 10, 2003 @08:37PM (#5481286)
    Then don't. The types are optional.

    $x = 1;

    Will still work. These three paragraphs should be reread:


    The important thing is that we're adding a generalized type system to Perl. Let us begin by admitting that it is the height of madness to add a type system to a language that is well-loved for being typeless.

    But mad or not, there are some good reasons to do just that. First, it makes it possible to write interfaces to other languages in Perl. Second, it gives the optimizer more information to think about. Third, it allows the S&M folks to inflict strongly typed compile-time semantics on each other. (Which is fine, as long as they don't inflict those semantics on the rest of us.) Fourth, a type system can be viewed as a pattern matching system for multi-method dispatch.

    Which basically boils down to the notion that it's fine for Perl to have a type system as long as it's optional. It's just another area where Perl 6 will try to have its cake and eat it too.


    (Bold added by me.)
  • by jbolden ( 176878 ) on Monday March 10, 2003 @08:40PM (#5481306) Homepage
    The default on perl 6 is to use perl 5 compatability mode. So you won't need both.
  • by nyamada ( 113690 ) on Monday March 10, 2003 @08:41PM (#5481310)
    pod (plain old documentation) is what most perl hackers use. Easier to maintain than javadoc and the documentation stays with the code.

    $ perldoc perlpod
  • Re:20-odd pages... (Score:2, Informative)

    by thoughtstream ( 140380 ) on Monday March 10, 2003 @09:14PM (#5481524)
    # Perl 6 code

    for @list.kv -> $index, $elem {
    # do something with $elem
    # do something with $index
    }
  • Nitpick -- the plural of "exegesis" is "exegeses", just as the plural of "apocalypse" is "apocalypses". Or at least, that's how Damian is writing it :-)

    And chances aren't bad that the next Exegesis will be coming soon, and the next Apocalypse will be soon after that. According to Dan Sugalski's use.perl.org journal, the core Perl6 team has been making good progress lately. As he writes in the 20 Feb journal entry:

    Once the Apocalypse is out, I expect that Damian'll get the Exegesis out in a few weeks, with the Synopsis either following or preceding, depending on how the tides and moon phases work out. We'll see there.

    From the later comments in that entry, it sounds like the next Apocalypse / Exegesis / Synopsis will deal with Perl6's object system. It's not clear how much progress was made there though. It took a long time to get from the last Exegesis to today's Apocalypse (core developers all out of work, etc), but hopefully this means things will get moving again now.

  • Re:ughgh (Score:3, Informative)

    by Eimi Metamorphoumai ( 18738 ) on Monday March 10, 2003 @09:43PM (#5481725) Homepage
    If you'd read the Apocalypse, you'd know that that line was taken directly from it (although it was an example of a possible implementation of a bit of the internals of perl).
  • Re:ughgh (Score:3, Informative)

    by wideBlueSkies ( 618979 ) on Monday March 10, 2003 @10:30PM (#5481947) Journal
    Yeah, but you don't have to write that way.

    There's more than one way to do it.

    You can write totally obfuscated/clever crap in any language. Or not. It's up to you.

  • by thoughtstream ( 140380 ) on Monday March 10, 2003 @11:24PM (#5482169)
    That's exactly why we made it possible to modify Perl 6's grammar. As paradoxical as it sounds, adding that flexibility gives us a way of overcoming the downsides of Perl's TMTOWTDI philosophy.

    It will be comparatively simply for a coding team to create a "policy" module (say, Policy/Our/Preferred/Style.pm) that restricts coders to an agreed-upon subset of the language's syntax and features. Thereafter, so long as every module begins with use Policy::Our::Preferred::Style, the rest of the module simply won't compile unless it conforms to the team's coding standards.

    And I suspect that enough groups will want to do this that it will make sense for someone to write a front-end module that simplifies the creation of such policies. So all your team will need to write will be something like:
    module Policy::Our::Preferred::Style;

    use Policy::Specification
    blocks => 'K&R',
    elses => 'cuddled',
    disallow => << unless until statement_modifiers junctions>>,
    # etc.
    ;
  • We biologists have a special word for stable. It is "dead".

    Interesting that that quote is Jarkko's sig. Jarkko is the Perl 5.8 pumpking.

  • by guardian-ct ( 105061 ) on Tuesday March 11, 2003 @12:27AM (#5482476)
    Larry Wall does seem to have taken seriously the "Nothing is sacred" bit. Earlier in Apocalypse 5, he wrote (about the earlier (?...) regex syntax decision) "It's not correct now, since the Perl 6 approach is to break everything that needs breaking all at once."

    So, I wouldn't worry too much about it. Perl 6 will be different from 5. It appears that it should be better when you look at it from certain directions, and worse from others. Paradigm shift? Sure. I think lwall just got bored with where Perl 5 was going, and wanted to do something different.

    Anyway "* signifies a glob" is one of those sacred things that was to be examined carefully. I'm guessing that most useful existing Perl 5 code doesn't use "*" that way except for filehandles. Several other 'modern' languages use "*" for type definitions, so it might make sense from the point of making it easier for a new Perl6 programmer to learn.
  • by Anonymous Coward on Tuesday March 11, 2003 @03:03AM (#5482920)
    Here are the directions [perldoc.com] on how to use perl's POD in-comment documentation format that the previous poster mentioned. POD can indeed be either read back in a Manpage-like CLI client, or used to create very nice looking webpages. In fact, it appears the URL i just linked was created in POD.

The Tao is like a glob pattern: used but never used up. It is like the extern void: filled with infinite possibilities.

Working...