Yesterday's punctuation dilemma was fixed by Juerd's nice proposal, namely using ./method
as a shorthand for $?SELF.method
. Larry calls it terminally cute, and I promptly implemented it in Pugs. Juerd++!
Lots of OO works were done today after I got my laptop back:
class Foo is Bar { ... }
method :foo { ... }
.:method
has $:attr
"$obj.hello() World"
.
method foo returns Hash of Int
. I need to ask about how to define such parameterised classes some day...
@{...}
and %$foo
etc.
Much thanks to Stevan, eric256, Darren and chromatic for their early adoption of Pugs OO. I'm happy to see that Locale::KeyedText, the first non-core Perl 5 module ported to Perl 6, is back to ext/
as it works now. Was it really only two months ago? :-)
In other news, in non-embedded mode (such as on Win32, by neccessity), Pugs 6.2.3 spawns one Parrot process for each Perl 6 rule match, which is horribly slow. I've written some more PIR so only one Parrot process is kept now.
Juerd helpfully informed me that the use of infix:<!>
to construct none()
junctions has been denied, so it's gone from Pugs.
eric256 p6ified life.p6 a bit, but notes that it's still slow. Well, that's what the Prarot compilation backend is for. Speak of which...
...Much to my delight, jhorwitz started hacking Pugs's Parrot codegen in earnest, in order to get mod_pugs
working in mod_parrot
. Hrm, should we call Pugs/Parrot people lambdabirds? :-)
scook0 and bsb diligently added more Haddock to Prim, Run and Monads modules. skew begins looking into the type tree implementation in Context.hs; hopefully we'll making it a proper directed graph some day to facilitate faster queries.
Stevan started writing tests for Test::Builder
, which is dangerously close to fully functional now. He also updated meta_meta_classes.pod with a snippet of discussion between gaal and him, to explain the raison d'être of MetaMetaModels.
The ever-inventive iblech implemented an IRC log to HTML converter in Perl 6. It's not huge -- 300ish lines -- but neatly shows how real world Perl 6 scripts looks like.
Oh, and I submitted two talks to Euro OSCON today: Perl 6 in the Real World, and Learning Haskell. I think I may be a bit overboard on the description for the latter:
What's faster than C++, more concise than Perl, more regular than Python, more flexible than Ruby, more typeful than C#, more robust than Java, and has absolutely nothing in common with PHP? It's Haskell!Tired of writing unit tests to cover corner cases? Let the computer write them for you with QuickCheck. Find regex-based parsing unmaintainable? Learn how to write a complete parser for Perl 6's grammar in 15 minutes with Parsec. Stuck in deadlocks and race conditions? STM solves all your concurrency woes. XS and SWIG gives you headaches? FFI lets you embed C code quickly and safely.
Haskell is an emerging general-purpose functional language, with unique features that enables extremely rapid development of bug-free, concise and maintainable code. This talk shows how to apply Haskell to day-to-day tasks, tips for integrating it with other languages, and secrets for boosting your productivity by an order of magnitude.
I blame the poignant why the lucky stiff for the influence. :-)
Re:meta-meta-classes
autrijus on 2005-05-16T06:28:35
Hmm, my understanding is that meta-meta-class does not exist in the language per se; it is a concrete implementation of the metaclass in the compiler or interpreter itself. The user would have no way to directly access or manipulate meta-meta-classes -- it is essentially an "out of system" thing of interest only to language implementors.Re:meta-meta-classes
stvn on 2005-05-16T21:14:38
Tom,As Autrijus pointed out, the meta-meta-class is not accesible in the "user space", but a language implementation level object. And the reason we are calling it the meta-meta-class is that it actually is not MetaClass itself, but a MetaClass is an instance of the MetaMetaClass. (it's confusing I know)
To expand on your example: the
class Book {}
can be called "Book". When you call themeta
method on Book, you will get an instance of the Class metaclass for Book, not the Class class.At some point in any object model there needs to be a cycle. In some models that cycle is at Class. So that Class is itself an instance of Class. However in perl6, we need more things that just classes (Roles), so we would need to push the cycle up one more level so that Class and Role themselves are instances of MetaClass. The MetaMetaClass then comes in as the concrete language implementation level element which the MetaClass is an instance of.
Okay, I think I actually confused myself with that reply, hopefully though I have not made it worse for you. Also please note that the documents have actually been updated with improved nomenclature, you might want to read them again.
StevanRe:meta-meta-classes
tyan on 2005-05-17T06:57:08
Hi
Thanks for your detailed response and amazing work getting oo going in pugs. Still twisting my brain into the right shape to fit this stuff in:-)
As you say, calling C<meta> on the C<Book> class yields an instance of the C<Class> metaclass that describes the C<Book> class. My example takes this one step further by calling the C<meta> method on this metaclass and (by my assumption) getting an instance of the C<Class> metaclass that describes the C<Class> class. This is based on my assumption that there is a cycle at the Class level. I would have thought that for any class A, A.meta.meta =:= A.meta.meta.meta. Is this not the case (I am only considering how things work at perl6 level)?
Tom
Re:meta-meta-classes
stvn on 2005-05-17T17:18:08
TomLet me first say that we are venturing into unspecced territory here. So anything I say is subject to the whim of @larry.
What said you is correct, with one minor adjustment. You said:
But you missed a few metasMy example takes this one step further by calling themeta
method on this metaclass and (by my assumption) getting an instance of theClass
metaclass that describes theClass
class. This is based on my assumption that there is a cycle at the Class level:) And yes,My example takes this one step further by calling themeta
method on this metaclass and (by my assumption) getting an instance of theClass
metametaclass that describes theClass
metaclass. This is based on my assumption that there is a cycle at the MetaClass levelA.meta.meta =:= A.meta.meta.meta
is true, as isA.meta.meta.meta =:= A.meta.meta.meta.meta
and on ad infinitum.Aren't meta-meta-classes fun
:)
Re:Haskell for the Masses?
autrijus on 2005-05-16T21:51:13
This is an interesting idea, but I cannot consider it until Perl 6's release, i.e. by Christmas...