in reply to Re^6: Perl Vs Ruby
in thread Perl Vs Ruby
But yeah, you could implement something similar to ruby on top of perl if you're willing to sacrifice some speed. The problem with doing that, is that you'll end up with a fancy OO framework that isn't used by 90% of the code out there, which means you won't be able to use much of it when you're interfacing with most CPAN modules.
See Moose - which looks pretty nice but isn't even trying to offer much above some OO syntactic sugar (nothing like a standardized collection / iterator interface, for example) on top of Class::MOP. If Moose and Class::MOP would have been in the core since perl 5.0, much of the collection constructs would probably have been built on top of them, and been much cleaner and extensible/swappable with user types because of it (and tie is an annoying hack). That's one of the most important things that Ruby offers over perl.
In languages like ruby & perl, OO is such a common need that the basic interface and conventions just HAVE to be worked out by the standard library, or you'll end up with a mess of third-party extensions all using more or less similar, but in practice non-interchangeable, interfaces - and being able to swap implementations around without changing the code that uses them is one of the most important uses of OO.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Perl Vs Ruby
by stvn (Monsignor) on Nov 26, 2008 at 22:23 UTC | |
by Joost (Canon) on Nov 26, 2008 at 23:18 UTC | |
by stvn (Monsignor) on Nov 27, 2008 at 17:54 UTC | |
by Joost (Canon) on Nov 27, 2008 at 20:37 UTC | |
Re^8: Perl Vs Ruby
by LanX (Saint) on Nov 26, 2008 at 22:25 UTC | |
by Joost (Canon) on Nov 26, 2008 at 23:22 UTC |