develooper Front page | perl.perl5.porters | Postings from July 2012

Re: Objects without stashes?

Thread Previous | Thread Next
Chris Prather
July 10, 2012 14:17
Re: Objects without stashes?
Message ID:
On Tue, Jul 10, 2012 at 11:03 AM, Reini Urban <> wrote:
> On Sun, Jul 8, 2012 at 11:35 AM, Jesse Luehrs <> wrote:
>> On Sun, Jul 08, 2012 at 10:17:31AM -0500, Reini Urban wrote:
>>> On Fri, Jul 6, 2012 at 11:34 AM, Leon Timmermans <> wrote:
>>> > On Fri, May 25, 2012 at 8:47 PM, Reini Urban <> wrote:
>>> >> Simplier? A MOP will always be more complicated and slower.

>>> > I don't think a MOP has to be slower, in fact I can imagine it being
>>> > faster than what we're using now.

>>> A MOP is by definition slower. It is a HUGE overhead.
>>> Please do some basic readings what a MOP is.

>> There is nothing about a MOP that requires it to be "by definition" slower.

> Sorry, it *IS* by definition bigger and slower.

I think I'm going to regret asking this but what definition are you using?

Wikipedia's definition is pretty close to what I've traditionally
always understood a MOP to mean (based on reading Art of the
Metaobject Protocol, Putting Metaclasses to Work, and whatever else
stevan threw at me over the years):

    A metaobject protocol (MOP) is an interpreter of the semantics of
a program that is open and extensible. Therefore, a MOP determines
what a program means and what its behavior is, and it is extensible in
that a programmer (or metaprogrammer) can alter program behavior by
extending parts of the MOP. The MOP exposes some or all internal
structure of the interpreter to the programmer. The MOP may manifest
as a set of classes and methods that allow a program to inspect the
state of the supporting system and alter its behaviour. --

By this (and every other definition I've read) Perl5 has has a MOP
since around the time of a0d0e21ea6ea90a22318550944fe6cb09ae10cda,
because the packages / statshes / globs that people complain about
form a protocol for introspection and altering program behavior. It
just happens that in Perl5's case for the first decade of it's life it
didn't "manifest [the MOP] as a set of classes and method".

There is nothing intrinsic that I can see in this definition that
automatically means that a MOP *must* be "a HUGE overhead", there is
nothing in the definition that says that it must be bigger and slower
than what we have now (packages/stashes/globs). In fact by the strict
definition what we have now *is* a MOP.

So what basic readings on MOPs have I missed?


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About