=pod =head1 NAME 10,000 ft view of the Perl6 MetaModel (2.0) =head1 DISCLAIMER It should be noted that version 2.0 of the Metamodel is not yet complete, and is still missing some core features. However it currently does have the base elements needed to support those additional features. This document describes the current state of the metamodel, so it I change. =head1 NOTATIONAL CONVENTIONS i(Foo) - instance of Foo class(Foo) - the instance of Class named "Foo" =head1 DESCRIPTION Here is the basic layout of the metamodel 2.0 (in ASCII art). ----------------------------------------------------------- : +---------------+ : | i(Foo) | : +---------------+ : | class |----+ : | instance_data | | : +---------------+ | : | : +--------------------------+ : | : | +---------------+ : +---------------+ +---->| class(Foo) | +---:---->| class(Class) |<---+ +---------------+ | : +---------------+ | | class |---+ : | class |----+ +---------------+ : +---------------+ | name | : | name | | version | : | version | | authority | : | authority | | %methods | : | %methods | | %attributes | : | %attributes | | ... | : | ... | +---------------+ : +---------------+ : =head1 BOOTSTRAPPING This is a rough description of the bootstrapping process. It follows the files which are loaded, and what those files do. =over 4 =item I This file contains all the primitive elements needed for the meta-model including global functions (C, C, etc.), method generators, tagged attribute types, and opaque instance creators. This is also where the Perl 5 magic exists to allow for "normal" method dispatching behavior. =item I This file creates a the basic class C<$::Class> manually, and then adds the C function to it. This is the very first "object" in our system and after this is loaded, we can actually start using it as such. =item I This fills in the remaining methods in C<$::Class>, each method giving C<$::Class> more and more capabilities. It also then defines the attributes of C<$::Class>. Once this file is loaded, we have a fully formed class C<$::Class>, however it is not over yet. =item I This file constructs C<$::Object> using the same tools used in F and F. =item I This file connects C<$::Class> to C<$::Object> by adding C<$::Object> to C<$::Class>'s superclass list. We also manually populate the MRO's of both classes to avoid meta-circularity issues. We now have a working object model, and at this point, the following things are true: class($::Class) is an instance of $::Class class($::Object) is an instance of $::Class $::Class is a subclass of $::Object Or represented visually here: ---> is subclass of ...> is instance of class($::Class) : ^ : : V : $::Class ------+ ^ | : | : | class($::Object) | ^ | : | : | $::Object <-----+ =item I This package loads all the other files above, and then provides what I am calling a "macro" layer to make class construction easier. This layer will likely be handled by the language parser in a real implementation, but is here purely for prototyping/testing convenience. =back =head1 AUTHOR This basically means that anything incorrect in here is my fault. Stevan Little Estevan@iinteractive.comE =cut