Almost two months ago when I was in .nl, Stevan and I worked out the ObjectSpace bootstrapping plan, decomposing Perl 6's object model into method calls of a few native types, so we can build all boxed types, classes, roles and containers on top of them.
This approach is needed because our target runtimes (Perl5, Parrot, JavaScript) have wildly different method dispatch semantics. In the PIL1 era, each backend needs to bootstrap the object model differently, resulting in massive code duplication and subtly different semantics on eg. private methods and role composition.
Today I'm glad to report that Stevan's Bootstrap code is capable of representing roles, private methods, multiple inheritance with C3 dispatch order, built on full introspection and object space enumeration capabilities offered by the PIL.Native (PILN) runtime. PILN is a small language with only literals, variable lookups and primitive (potentially statically bound) method calls. Typing make pil in the Pugs source tree will build its interpreter; tests are in the t/pil/ directory.
The next step is to represent container types as instances of ::Class, and group their methods into a Roles hierarchy. Fortunately, Scala, Ruby and C# has done much of the hard work for us -- with Code, SigList, ArgList and other PIL2 base classes implemented, we can then hook it to a Perl 6 parser and complete the 6.28.0 milestone.
Recent Comments