| 1 | --------------------------------------------------------------------- |
|---|
| 2 | Perl 6 Object Meta Model |
|---|
| 3 | --------------------------------------------------------------------- |
|---|
| 4 | |
|---|
| 5 | This is a first sketch/prototype of the Perl 6 Object Meta Model. It |
|---|
| 6 | is very much a work in progress, and any thoughts/ideas/suggestions |
|---|
| 7 | are very much welcome. |
|---|
| 8 | |
|---|
| 9 | Currently the people involved in this are: |
|---|
| 10 | |
|---|
| 11 | Stevan "stevan" Little & Sam "mugwump" Vilian |
|---|
| 12 | |
|---|
| 13 | Contact them on #perl6 for more details. |
|---|
| 14 | |
|---|
| 15 | The many levels of introspection |
|---|
| 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 17 | There are several "layers" to the Perl 6 object system. Overview |
|---|
| 18 | information can be found in: |
|---|
| 19 | |
|---|
| 20 | docs/meta_meta_classes.pod |
|---|
| 21 | |
|---|
| 22 | off the Pugs root there is some more information: |
|---|
| 23 | docs/class/* |
|---|
| 24 | src/Pugs/Class.hs |
|---|
| 25 | |
|---|
| 26 | Each level is currently being developed in parallel, as |
|---|
| 27 | |
|---|
| 28 | M1 - Class level - the language Model |
|---|
| 29 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 30 | The Perl 6 "clean" prototypes of Perl 6 core language entities, for |
|---|
| 31 | example the "Class" class defined as a class, can be found in; |
|---|
| 32 | |
|---|
| 33 | lib/* |
|---|
| 34 | |
|---|
| 35 | These entities should be derived primarily from features required by |
|---|
| 36 | things in the Synopses. In particular, most of S29 should end up |
|---|
| 37 | defined as methods on classes in this directory. |
|---|
| 38 | |
|---|
| 39 | Currently in Pugs, the closest corresponding entities are; |
|---|
| 40 | |
|---|
| 41 | - Compiled Types: |
|---|
| 42 | - MkType inserting to envClasses in Pugs/AST/Internals.hs |
|---|
| 43 | |
|---|
| 44 | - "Core" types, including "Classes": |
|---|
| 45 | - Type in Pugs/Types.hs (as a base class) |
|---|
| 46 | |
|---|
| 47 | - VStr, VBool, VInt, VRat, VNum, VComplex, VHandle, VSocket, |
|---|
| 48 | VThread, MatchPGE in Pugs/Types.hs |
|---|
| 49 | |
|---|
| 50 | - VRef, VOpaque, VControl, VScalar, VPair, VList, VSubst, |
|---|
| 51 | VArray, VHash, VThunk, VProcess, VMatch, VCode, VJunc, |
|---|
| 52 | VObject, VType in Pugs/AST/Internals.hs |
|---|
| 53 | |
|---|
| 54 | Classes that are what you would get out of introspecting the Haskell |
|---|
| 55 | source at: |
|---|
| 56 | |
|---|
| 57 | lib/Pugs/*.pm |
|---|
| 58 | |
|---|
| 59 | Attribute names should be taken from the Haskell source where |
|---|
| 60 | possible. Note that there are several Haskell constructs that are |
|---|
| 61 | hazy areas about how the same thing is written in Perl 6; Haskell is |
|---|
| 62 | an advanced language! |
|---|
| 63 | |
|---|
| 64 | M2 - Meta::Class level - the langauge Meta-Model |
|---|
| 65 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 66 | These objects represent data structures capable of describing the M1 |
|---|
| 67 | classes, and changes that are permitted to the M1 objects, such as |
|---|
| 68 | defining new Class traits. These are being built in: |
|---|
| 69 | |
|---|
| 70 | lib/Meta/*.pm |
|---|
| 71 | |
|---|
| 72 | M3 - Meta::Meta::Class - the language Meta-Meta-Model |
|---|
| 73 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 74 | These are designed to be a minimal set of classes that can describe |
|---|
| 75 | any Meta::Model. |
|---|
| 76 | |
|---|
| 77 | If we follow the same path that SmallTalk72 did when they found the M3 |
|---|
| 78 | was unnecessary, then perhaps the M3 will be unnecessary. |
|---|
| 79 | |
|---|
| 80 | For now, the M3 is based on the core Class support in Pugs, and the |
|---|
| 81 | module; |
|---|
| 82 | |
|---|
| 83 | lib/Meta/Util.pm |
|---|
| 84 | |
|---|
| 85 | This module generates accessors which support the Class::Tangram |
|---|
| 86 | collection message passing convention, which allows references and |
|---|
| 87 | collection properties of objects to "track" each other; see the last |
|---|
| 88 | few tests in t/01-util.t for an example of how this works. |
|---|