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...