cardinal-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cardinal-dev] an update on OOP in parrot


From: Pat Eyler
Subject: [Cardinal-dev] an update on OOP in parrot
Date: Tue, 28 May 2002 15:13:42 -0400 (EDT)

For those of you not on the Parrot/Perl-6 mailing list, this is an
interesting bit.

-pate

---------- Forwarded message ----------

From: Melvin Smith <address@hidden>
To: address@hidden
Subject: Cola update
Date: 24 May 2002 17:52:22 -0400

I've committed the latest revisions of the Cola compiler.
Primitive OOP is supported now. See the commit notes:

"Cola 0.0.6 now supports primitive OOP. You can define
class methods and call by class or instance. Instance
calls are currently faked into class calls and there
isn't yet support for member variables, only methods and
constants. Cola programs must have a static void Main
in one of the classes in order to be executable."

I'll be committing a ton of mods that will allow member variables
faked on top of a PerlHash or PerlArray as well as an
asm { } inline pragma that will allow us to write opaque system
classes to implement native Cola classes and namespaces.

I'm also going to encapsulate the Parrot VM inside a Parrot class
to make debugging the VM easier. Something like

public class Parrot {
     string GetVMStats()
     void GCCollect()
     int Eval()
     void SetDebug()
}

Also I'll be adding a lot more primitives so we can actually write
serious programs in Cola soon.

You can now include classes that you write with the C# using directive.

// Sample
using System;

class Test {
     public static void Main(string args) {
         Console.WriteLine("Parrot!\n");
     }
}


For now, modules are imported at the source level by colac,
which is simply a Perl wrapper that calls colacc, the raw
compiler. When we have fleshed out the class format and
bytecode symbol tables, I'll be able to simply scan symbol pbcs instead.

It's kludgy, but it sure is fun. :)

-Melvin






reply via email to

[Prev in Thread] Current Thread [Next in Thread]