I think it was Josh Susser that first said:
Ruby is the love child of Lisp and Smalltalk, raised by Perl the eccentric nanny.I really liked that quote. Of course I hated Perl at a time for being cryptic, outdated and old school. I assumed Perl had a little influence on Ruby, not even close to influence that Smalltalk and Lisp had.
After a couple of years of looking at Lisp, Smalltalk and Perl I would say: “Ruby is a Perl sister that’s not doing drugs”. She is more lovable but also less intriguing and wild.
At the one side we have a Lisp. It has no syntax sugar. It’s even proud of it. On the other side we have Perl. It has ALL the syntax sugar and then some. It’s even proud of it.
These are both valid approaches. It depends on personal taste where on the scale you decide to settle. My pick is Ruby, some other people may prefer Python.
I pity them because Python feels like jail to me since it has all of those “purity”, “sanity” (however you want to call them) constraints. They pity me because I shoot myself in a foot every once in a while (and only occasionally cut my throat) because Ruby lacks some of those constraints.
This goes in circles as a classical holly war tends to, but I had an epiphany yesterday, while watching Perl vs Python debate live from OSCON 2011.
Debate boils down to Python guy making fun of Perl guy for known Perl cruft and twarts. On the other side Perl guy is saying. We pioneered this, we pioneered that, we pushed the envelope on this… You can say that he could not care less about counter arguments since he is looking forward and not fixating on the past.
Inventors and Copycats
That made me wonder. I am already leaning toward “more-is-better” for syntax sugar school. I guess most people are, that’s why majority feels Lisp looks a bit oatmealish. We as humans are capable of graphical mappings. The Chinese grapheme system is proof of that. If you ask me my honest engineer opinion on that system and assign me a task to work on it I would probably like to see the authors of it dealt with like this. Nevertheless it seems to be working nicely for the Chinese.
Maybe it’s the same with Perl guys. That’s why they don’t mind when some Python guy makes fun of them with arguments:
You have 6 options, we’ve chosen to implement half of the third one. That’s why we are superior.
After learning Perl 5 I was feeling like Matz lifted all the good stuff from the Perl while not going wild on syntax sugar. It felt like purified Perl that has stolen Smalltalk messaging system in which the object orientation was not an afterthought. Suddenly Perl was worth a lot more on my scale. (Simultaneously I was able to pinpoint that Python feels like Ruby that hates Perl and therefore lacks all the goodies my heart longs for.)
I toyed with Perl samples and I was able to get results in Ruby with similar LOC. Ruby just felt a lot cleaner, especially in OO department and at the same time didn’t lack much feature/freedom/syntax sugar wise.
But the elusive Perl 6 that is being made fun of since late 2001 is a different story. I mean they’ve changed everything. When Larry Wall jokingly says that they plan to leapfrog all the other languages I think he is not joking at all.
As far as I am concerned they are pushing the envelope on these things:
- Function signatures (captures, named, optional, alternative named)
- Unpacking (destructuring)
- Regular expressions
- Passing params from console(MAIN)
- Grammars and grammar inheritance
- Hyper operator (Yay a new syntax sugar »«)
And also they’ve catched up on:
- OO syntax
- Roles (Ruby modules, Smalltalk traits)
Is Perl 6 Utopia? I hope not. Sure it’s easy to make fun of them for getting stuck because of “second system syndrome” and going insane with the features. BUT if they pull it of it has a potential to become the next great rewrite success story similar to OS X from NeXTSTEP.
Unit that Perl 6 can be a great inspiration for some amazing features that can get added to your language of choice.
On a side note it still puzzles me why is Python the only one without blocks. I mean everybody and their mother, including Objective-C has blocks syntax. Are anonymous functions not worthy of having proper representation.