This Week on Perl 6, Week Ending 2004-07-04

Another week, another Perl 6 Summary. This is becoming a habit.

Let’s do perl6-internals first, shall we?

Japhy’s Perl 6 Rules Parser

Last week Jeff ‘Japhy’ Pinyan announced that he’d be working on a Perl 6 rules parser once he’d finished his Perl 5 regex parser. This week saw a deal of discussion on how his parser worked. The answer seemed to be, “It works the Right Way.” Which is good. With any luck Steve Fink will be able to get this parser and the current (sketchy) Perl 6 compiler playing well together.

http://groups.google.com/groups?selm=Pine.LNX.4.44.0406262313030.28219-100000@perlmonk.org

Complexities

Last week Leo pointed out that we’d need support for complex numbers in order to get the Piethon stuff running properly. This week there was some discussion of what was actually needed.

Later in the week Ion Alexandru Morega posted a patch implementing them. I think Leo spoke for us all when he said, “Whee, great, thanks – applied.”

http://groups.google.com/groups?selm=20040627215622.37698.qmail@onion.perl.org

New Mailing Lists

There was some discussion of how perl6-internals should be broken up. It looks like we’ll see new lists called parrot-internals, parrot-compilers, and parrot-library (for internals hackers, compiler implementers, and library builders respectively). The original perl6-internals will carry on, but will be focused on the actual internals of Perl 6.

Some, or all, of these lists will be covered in these summaries for as long as I can keep up.

http://groups.google.com/groups?selm=Pine.LNX.4.58.0406280851280.16872@sprite.sidhe.org

Stack Language for Parrot

In as impressive a delurk as I’ve seen in some time, Michael Pelletier announced that he’d been lurking for a while, playing with Parrot, and had implemented a little stack language not entirely unrelated to Forth, which he’d christened Parakeet. He posted his implementation and got promptly Warnocked.

http://groups.google.com/groups?selm=1088570711.2678.648.camel@heinlein

GMP and Licensing Issues

Scott Bronson announced that he’d taken a look at GMP’s license and he didn’t think it was incompatible with Parrot’s licenses. Dan wasn’t convinced. Scott’s still trying to convince him though.

Robert Spier attempted to resolve the problem by pointing everyone at another possibly suitable library called IMath.

http://groups.google.com/groups?selm=1088572790.3306.100.camel@lea.rinspin.com

http://groups.google.com/groups?selm=m3wu1o8cb1.wl_rspier@pobox.com

Meanwhile, in perl6-language

Argh! Strings!

Discussion of the various ways of slicing and dicing strings in Perl 6 continued. The issue is that, especially in a Unicode world, there are many ways of looking at a string, all of which are useful in different contexts. However, because you can look at a string as a sequence of bytes, code points, graphemes, or whatever, then functions like substr get a little weird. If you were to say:

    $substring = $a_string, 5

Then what does the ‘5’ mean?

And that’s just one example of where conceptual problems can arise.

I confess that, whenever Unicode comes up, my gut reaction is to keep my head down and trust that Larry’s going to get it right. Certainly the current formulation seems decently sane; things only get problematic if you’re trying to do something well out of the ordinary.

http://groups.google.com/groups?selm=20040626202059.GA1747@wall.org

if, loop, and Lexical Scope

Discussion of Perl 6’s new scoping rules (things are generally more consistent than they are in Perl 5; if a variable is declared inside a block, or in that block’s signature in the case of -> $a, $b {...} type blocks, then that block is its scope) continued. Some people like the new rules, others don’t.

http://groups.google.com/groups?selm=20040627211611.GB3013@babylonia.flatirons.org

Different OO Models

Jonadab the Unsightly One had wondered about having objects inheriting behavior from objects rather than classes in Perl 6. The gist of the answers he received was that it wouldn’t be in the core of the language, but neither should it be too hard to implement something that worked how he wants.

http://groups.google.com/groups?selm=n02nraxl.fsf@jonadab.homeip.net

Undo?

Michele Dondi wondered if Perl 6 would have a built-in undo function for rolling back the history of a scalar (say). Rafael Garcia-Suarez pointed out that the concept wasn’t as simple as it first appeared, especially in the context of threads, closures, side effects. He suggested that a better approach would be to implement a suitable transaction/rollback library that handled such things in an application-appropriate fashion rather than using a “half-baked kludge built into the base language.” Mark Biggar pointed out that the language already had hypothetical values, which did pretty much the right thing.

Elsewhere in the thread, Luke Palmer attempted to explain continuations again. A sandwich was involved.

http://groups.google.com/groups?selm=Pine.LNX.4.56L0.0406291740180.10615@worf.pcteor1.mi.infn.it

Luke makes a continuation sandwich – http://groups.google.com/groups?selm=20040629233129.GA3979@babylonia.flatirons.org

If Not , Then What?

Alexey Trofimenko triggered your Summarizer’s sense of déjà vu when he asked what was happening to the C-style comma (we’re keeping it, more or less) and proposing a then keyword for use in the contexts where Perl 6’s new , didn’t quite work the same way as in Perl 5. Which is pretty much the same as the proposal Luke Palmer made some months ago and which Larry rejected.

Jonathan Lang pointed out how you’d implement then if you needed it, though.

The thread got slightly silly after this (Sideways semicolons! I ask you!). I’m not sure what chromatic was driving at when he suggested a meh operator, though.

http://groups.google.com/groups?selm=opsafpwqtgsspxk8@s

map, grep and Laziness

That man Alexey also had some questions about lazy evaluation. Luke Palmer attempted to allay his fears by saying that Perl 6 would be essentially lazy unless you told it otherwise.

http://groups.google.com/groups?selm=opsajn0im2sspxk8@s

Announcements, Apologies, Acknowledgements

Woohoo! Another weekly summary.

If you find these summaries useful or enjoyable, please consider contributing to the Perl Foundation to help support the development of Perl. You might also like to send me feedback at mailto:pdcawley@bofh.org.uk

http://donate.perl-foundation.org/ – The Perl Foundation

http://dev.perl.org/perl6/ – Perl 6 Development site

Tags

Feedback

Something wrong with this article? Help us out by opening an issue or pull request on GitHub