Slashdot Mirror


Run Perl 6 Today: Pugs 6.0.11 released

autrijus writes "I am delighted to announce that Pugs 6.0.11 is released, with experimental pugscc support to turn Perl 6 programs into stand-alone executables, as well as many new features. Pugs is an implementation of Perl 6, written in Haskell. For more information, see Pugs Apocryphon 1 and this perl.com interview."

5 of 97 comments (clear)

  1. Re:is Perl 6 already standardised? by CaptainPinko · · Score: 5, Informative

    Has Perl 6 been specified?

    By December 2004, most of Perl 6 has been specified as a series of Synopses. Although not considered final, it is now stable enough to be implemented. Many of the Synopses are based on Larry's Apocalypses. Sometimes the design team releases Exegeses, which explain the meaning of Apocalypses. Pugs adheres to the Synopses, referring to Apocalypses or Exegeses when a Synopsis is unclear or imprecise.

    ---

    Still doesn't answer what the Perl6 folks are waiting for...

    --
    Your CPU is not doing anything else, at least do something.
  2. Developers Needed by Anonymous Coward · · Score: 4, Informative

    The Pugs implementation effort is test-driven. In many cases, a few hours pass between the arrival of a new test and the implementation of a feature. So, anyone who knows (or would like to try) Perl 6 can contribute tests to Pugs. No knowledge of Haskell is required at all.

  3. Re:perl6 is a mistake by Anonymous Coward · · Score: 1, Informative
    You can in fact do this with plain old Perl 5 regexes, as follows - to quote from Jeffrey Friedl's excellent Mastering Regular Expressions, 2nd Edition, p. 328-331:
    my $LevelN;
    $LevelN = qr/ \(( [^()] | (??{ $LevelN }) )* \) /x;
    This dynamic regex matches text within an arbitrarily-nested set of nested parentheses, by recursively 'calling' the compiled regex $LevelN from within itself - the left hand condition of the alternation is the exit condition. It works in Perl 5.6 or higher, maybe even earlier - just tested it.

    Of course, Perl 6 makes this sort of thing much easier and has a built-in Parse::RecDescent feature within regexes, but the overall complexity of the language is quite scary. I'm looking at OCaml, which is higher level than Perl (though with some features in modules and less syntactic sugar) and almost as fast as C/C++. It's also functional and OO, more details on my OCaml page
  4. Re:perl6 is a mistake by Anonymous Coward · · Score: 1, Informative

    That said, I'm also looking at switching my people from Perl to either Ruby or Python.

    If you use Parrot implementations of Ruby or Python in the future, you'll be able to freely mix Perl 5, Perl 6, Ruby, Python, Tcl, et al. Which means that:

    Things I love about Perl that I'll be sorry to walk away from:
    - CPAN; an amazing resource


    You will have access to any CPAN module from any supported language using your language of choice native syntax.

    - for 100 line scripts, the ability to code as quickly as I can type, with few errors when I try to run for the first time

    You will be able to write those pieces in Perl 5 or Perl 6 without losing any interoperability with other supported languages.

    - Perl's ability to bolt stuff together that was never meant to be bolted together

    You will be able to use Perl 5 or Perl 6 for that, or other languages in case Parrot itself inherits said ability to your satisfaction.

    - DBI model; it's so simple and elegant

    Using Parrot implementation of Python, you will be able to write:

    dbh = Perl.DBI.connect("dbi:Pg:dbname=yourdb", "user", "pass")

    and have a Perl object referenced by your Python variable, with correct DBI semantics but with native Python syntax.

    - regular expressions; don't know why, but Perl's regex's seem to be more natural than any other language's equivalent

    Perl 5 regular expressions, as well as Perl 6 rules, will be both available directly in Parrot.

    I am a die-hard Perl guy, I will use Perl 6, but I am glad that no one will have to use it to cooperate with me. You will be able to write in Python, someone else in Ruby, another guy in Perl 5 and me in Perl 6, and still we'll be able to write our own CPAN module together and everyone will be able to use it not even thinking about the languages it was written in. This is something like .NET, only it will work and will be Free.

  5. Length is gone by Pan+T.+Hose · · Score: 0, Informative

    In answer to your length of the keys array of a hash question, just use (keys %hash) in a scalar context, or (keys %hash).length.

    Wouldn't it be nicer if you could do %hash.keys.length ..or would that be too much sens^H^H^H^H like Ruby?

    As Larry said in Apocalypse 12, "The length() function is gone" because "[it] has been deemed to be an insufficiently specified concept, because it doesn't specify the units."

    In other words, is $x.length the length of $x in characters and @x.length the number of elements in @x? What if $x is an array reference? What if we want to know the number of characters in @x, as is often useful when the array in question is the output of other program, or stdin? We could use a hyper version of the length method or junctions, or map, or loop, or...

    But simple things should be easy, and the length method would be ambiguous. So there is no %hash.keys.length in Perl 6. There is %hash.keys.chars and %hash.keys.elems, or just %hash.elems. The references to container data types are automatically dereferenced, so $hashref.elems does what you need without the need to explicitly dereference anything.

    Summarising, the correct version of (keys %hash).length in grandparent post should be %hash.elems and (keys $hash{"key"}).length should be %hash{"key"}.elems which seems quite straightforward if you ask me.

    If it makes too much sense then you certainly shouldn't read the rest of Apocalypses, Exegeses and Synopses. You have been warned.

    --
    Sincerely,
    Pan Tarhei Hosé, PhD.
    "Homo sum et cogito ergo odi profanum vulgus et libido."