Metaclasses sounds like Smalltalk, not like Self/Javascript.

Careful, prototype OO is not all it is cracked up to be, it is enjoying a small comeback now that Javascript is being taken seriously. But having been a Javascript programmer for 10+ years now, I can say, its not as cool as people think it is, it's just different. Prototype OO offers you a finer grained re-use mechanism with the prototypical object, but it fails to scale to the needs of larger project organization. Whereas classes have proven themselves in this regard, and Roles with their horizontal re-use have great potential.

The prototype-ish features of Perl 6, specifically the "class but undef" feature:

my Dog $fido;
The value of $fido is undef, but it is typed as a Dog, and can therefore respond to $fido.can('bark'), but cannot respond to $fido.bark(). This can easily be implemented by applying a runtime role to the undef value, that role is parameterized with the class (in this case Dog) and can then respond to the limited number of method calls.

Also, it is much easier to create a prototype OO system on top of a class based system then it is to do the opposite. Here is an example of Prototype OO layer for Moose, and at one point I had a version of the Perl 6 MetaModel that was in Javascript which would have shown a good example of how tedious is to make classes in prototype land, but you can actually just take a look at all the new JS frameworks there, most of them try to do it.

-stvn

In reply to Re^3: Perl 6 Shocking Revelations II - classes are built, not declared by stvn
in thread Perl 6 Shocking Revelations II - classes are built, not declared by John M. Dlugosz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.