Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rodi (7124)

rodi
  (email not shown publicly)

Journal of rodi (7124)

Tuesday September 26, 2006
12:26 PM

Perl Advent?

Advent is a happy time around the Brunton household. To begin with, it means Christmas is coming. I'm a big fan of Christmas. Each Sunday of Advent, we invite a couple friends over and have dinner. Maybe light a candle on the Advent wreath.

But this year... this year it's looking like it may be the biggest Advent *ever*! And not just because we have babies in the house now. Tucked away at the end of his State of the Onion is the following tidbit from one Mr. Larry Wall:

"Now, anyone who has been following along at home knows that we never, ever promise a delivery date for Perl 6. Nevertheless, I can point out that many of us hope to have most of a Perl 6 parser written in Perl 6 by this Christmas."

Can it be?

Every time someone logs in to #perl6 and asks "when will it be done?" (this happens a couple times a week), there is always a collective cheer from the crowd of LambdaCamels hanging out there:

CHRISTMAS!

But nobody will ever say which Christmas.

Until now.

Perl 6 Advent anyone? I'm thinking

  • Old Testament readings (Perl <=5)
  • New Testament readings (Perl 6)
  • An Epistle (Synopses?)
  • And some Psalms (Perl poetry)

This is not to mention Apocrypha, Apocalypses, and Exegesese. Maybe when it's all done, we'll turn it into the Perl Catechism.

Thursday September 14, 2006
11:56 AM

User dug Read This (or, Cellular Automata for Kicks in 6)

A while back, I sent my little brother (user dug) some Perl 5 scripts that render simple cellular automata to a terminal.  I thought he'd ignored me entirely until he publicly prodded me to see the Perl 6 versions I was (allegedly) working on.

Well, the module is checked into Pugs (Automata::Cellular), and here's a sample script:

use v6-alpha;
use Automata::Cellular;
my Automata::Cellular $ca .= new(:rule_number<30>);
say "Rule Number $ca.rule.rule_number()\n$ca.rule.pretty()\n$ca.prettystate()";
while ( $ca++ ) { say $ca.prettystate() }
1;

With output:

Rule Number 30
... becomes .
..x becomes x
.x. becomes x
.xx becomes x
x.. becomes x
x.x becomes .
xx. becomes .
xxx becomes .

Stage 1: ...............x...............
Stage 2: ..............xxx..............
Stage 3: .............xx..x.............
Stage 4: ............xx.xxxx............
Stage 5: ...........xx..x...x...........
Stage 6: ..........xx.xxxx.xxx..........
Stage 7: .........xx..x....x..x.........
Stage 8: ........xx.xxxx..xxxxxx........
Stage 9: .......xx..x...xxx.....x.......

I found the Perl 6 object model powerful, the interfaces easy to use.  For example, I overloaded the "++" operator using a method like this:

method prefix:<++> {
  ## increment the state
}

Wow!

Adding an accessor to the class was even easier.  I didn't even read any documentation- I just tried it, and it worked.  Inside the class or role, just say something like:

has $.foo;

If you want something to type into Pugs, try this:

class a { has $.b }; my a $c .= new(:b<foo>); $c.b()

Yes, you really did just build a class called "a", create a new class a object, and use the "b" accessor.  Wow.

So dug, now you know why I have become a citizen of Perl after ten years.  Moose!
Wednesday September 13, 2006
01:53 PM

A Citizen of Perl (or, In Praise of Audrey T)

I confess that I am, and have long been, a Perl resident alien. I have used Perl 3, 4 and 5 professionally for over a decade, beginning in tech support in Seattle, ending in application development in DC. But I have done so without ever becoming a citizen of Perl. I have never released anything on CPAN or participated in mailing lists and IRC. I have not written in a use.perl.org journal, and I have not attended a YAPC. I have just hacked away Perl in solitude, even when part of a development team.

But back in July, that all changed.

"I wonder," I thought, "how the various Perl 6 projects are coming along?"

So I svn'ed myself a copy of parrot and pugs (this was before #perl6 people converted me to SVK), and proceeded to build.

I built parrot first- though I ended up falling back to the tarball, never getting my bleeding edge checkout to compile all the way through.

Then I built Pugs. Ah, beautiful Pugs.

I think it was about ten seconds later that I was pasting some code from one of the Synopses into Pugs.

Lo and behold! It didn't work.

Not easily discouraged, I logged on to #perl6, and asked if I was doing something wrong.

Within ten minutes, I had a commit bit. If you have one, you know how easy this is to get, but if you don't you probably think it's a pretty big honor, like I did at the time.

Within a week, I had written several tests and updated several more test files.

Within a month, I had written my first Perl 6 script (ext/ca_wolfram.pl, if you have a Pugs repository handy).

Within two months, I had made small contributions to Pugs itself (added sprintf("%b",... to Prelude.pm, changed meta to META in Pugs.Prim, etc.).

I even asked a question on perl6-language.

And Larry-Frikkin-Wall-Himself actually responded. Larry Wall! To me!

Just this week, I have added Automata::Cellular version 0.1 to the Pugs repository.

And today... today I am writing a use.perl.org journal.

How did this all happen? Why the sudden change?

Well, I logged on to #perl6, and asked my question. In retrospect, it was kind of a dumb question, and I probably didn't ask it as nicely as I might have. But instead of being met with ridicule, silence, or any other unwelcoming derision, I was summarily informed that I had found an unimplemented feature.

Audrey then asked me for my email address, which I gave her.

She sent me a commit bit, told me to add myself to AUTHORS (what?!), and to then submit a test.

And now, on this day, I find myself a citizen of Perl. May there always, and forever be, more than one way to do it.