Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

FWIW the Perl 6 MOP is heavily inspired by the Common Lisp MOP. Or to put it another way, it steals the good parts.

But for many people, it also has nicer syntax :-)



They forgot to steal the syntactic part then ;)

Do you have links about influnce of CLOS MOP in Perl6 ? For what it's worth I do love Perl6 efforts like first class grammar/rules.


I can't seem to locate definitive sources at the moment, but it's mentioned often[1]. My general understanding of it is that the MOP is heavily influenced by CLOS, and the object system heavily influenced by the Smalltalk traits paper, which may itself have heavy CLOS influences. The easiest way to figure out just how similar they are may be to look at the Perl 6 docs on both the MOP[2] and Objects[3]. There's also the synopsis[4] documents which guide the design.

In addition, Perl 5's Moose[5] object system (and relatives Moo, Mouse, etc) are also heavily influenced by Perl 6, CLOS and Smalltalk.

1: http://irclog.perlgeek.de/perl6/search/?nick=&q=clos

2: http://doc.perl6.org/language/mop

3: http://doc.perl6.org/language/classtut

4: http://design.perl6.org/

5: http://moose.iinteractive.com/en/


Ha.. googling perl6 mop never led me to doc.perl6.org. Thanks a lot for the history!


They deliberately forgot to steal the syntactic part. :)

The P6 project assumed it's possible to create hygienic lisp style macros without homoiconicity. In fact it's always been known that it's theoretically possible to create lisp style macros without homoiconicity, but it's usually been considered too darned difficult. P6 has definitely not blinked in the face of "difficult" but it currently looks likely that they'll fail to get there (strong lisp style macro features) this year. See 007 for the experimental sandbox created this year by the lead macro designer:

https://github.com/masak/007

http://masak.github.io/007/

(And maybe enjoy his toy lisp in P6: https://github.com/masak/ipso)

> Do you have links about influnce of CLOS MOP in Perl6 ? For what it's worth I do love Perl6 efforts like first class grammar/rules.

Here's an email written by Stevan Little in 2005. He was the lead designer of key elements of P6' OO, and the creator of Moose, the leading OO system in P5:

> I also borrowed many ideas from CLOS (in particular from book "The Art of the MetaObject Protocol"). CLOS is more like what you describe, where standard-class is the metaobject to define classes. I see this as mapping to the MetaClass, and our Class as being something akin to the find-class generic function in CLOS.

There's lots of bits like that scattered around the net.

I'm not sure if 6model was influenced by CLOS and it's technically not part of P6 as I understand it but it seems to be in the same space from an intentional point of view. In combination with P6's OO semantics it means it may well be practical at last to pass full blown objects back and forth among arbitrary OO languages in a high performance way. Again, doc is very hard to come by but here's what I've found:

https://github.com/jnthn/6model/blob/master/overview.pod


"Hygienic" macros are more annoying than they're worth.


The P6 design supports both hygienic and non-hygienic macros because they concluded there were strong use cases for both.

I think the Rakudo devs implemented hygienic macros first because they were expecting them to be more difficult than non-hygienic.


Line noise added to CLOS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: