Google Groups Home
Help | Sign in
Pugs-PIL: Containers adopts Roles.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Audrey Tang  
View profile
 More options Jan 2 2006, 2:53 pm
Newsgroups: perl.perl6.compiler
From: autri...@autrijus.org (Audrey Tang)
Date: Tue, 03 Jan 2006 03:53:28 +0800
Local: Mon, Jan 2 2006 2:53 pm
Subject: Pugs-PIL: Containers adopts Roles.

Today Stevan started writing out Roles for container types
<http://svn.openfoundry.org/pugs/src/PIL/Native/Bootstrap/Container.pil>,
so there can be multiple classes that implements the Hash/Array/Scalar
interface, so operations like .{} and .[] can apply to user-defined
types as well.

This is similar to the Perl 5 way of using the /"tie"/ interface, as
well as overloading /@{}/ and /%{}/, but because Perl 5 is a strongly
typed language with only five ($@%&*) container types, ultimately you
need to decompose the user-defined class to one of those five things,
XS-based solutions like PDL notwithstanding.

With roles, user-defined classes can be first class citizens that
conform to various interfaces (pair, args, sigs, list, ranges, etc...),
and it'd be much easier to write an ordered hash class that /does/ both
the Array and Hash interface.

We are working toward something like Scala's traits hierarchy
<http://scala.epfl.ch/docu/files/api/index.html>, starting with the bare
minimum already defined in docs/quickref/data
<http://svn.openfoundry.org/pugs/docs/quickref/data>.

As the main Bootstrap.pil is getting huge with the container type
interfaces, I factored them out into multiple small files in
src/PIL/Native/Bootstrap/
<http://svn.openfoundry.org/pugs/src/PIL/Native/Bootstrap>. The next
step for me is to create another surface syntax for PIL^2 -- this time a
bare subset of syntactically-valid Perl 6 -- and compile it to the
already-running-fine bootstrapped PIL^N runcore.

The compiler itself will have access to an object space, and simply
serialize the final (garbage-collected) state as the executable image,
ready to be run by invoking the main routine in /&*::('')/. Once we can
pass the t/01-sanity/ <http://svn.openfoundry.org/t/01-sanity/> tests
with this compiler, the rest of the job is to port all desugaring,
primitives, as well as other assorted magics from the old runcore over,
a process not unlike what iblech has been doing for the JavaScript
runcore. Stay tuned...

  signature.asc
< 1K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google