Ruby Vs Perl

First off, the facts:

Similarity Differences
Ruby is not similar to PascalLanguage other than the use of the "end" keyword. It is more similar to SmallTalk. (-- AustinZiegler?)

Apart from the curly brackets, is Perl anything like CeeLanguage?

Of course it is! For example: constructs like "for", "while" and "if", attribution ("="), +=, ternary operator (?:), printf, sprintf

Ruby uses a full PCRE library for regexes, so that part is virtually the same. I think Ruby is similar to Perl, but only in a broad philosophical sense. There's more than one way to do it; easy things should be easy, complex things should be possible, all that jazz. Ruby was written to meet pragmatic constraints, as was Perl. (YukihiroMatsumoto focused on weeding out ugly little inconsistencies and misfeatures as well; LarryWall was not so concerned with this.)

Among many differences are: a much better object system and much better functionals (being stuck with $_ is damned ugly IMO)...I write a lot of Perl code and practically think in it, but Ruby is still way easier for me to read. -- TheerasakPhotha

If you think being stuck with $_ is damned ugly, put 'use English;' at the beginning of your program and you can say $ARG instead of $_. English.pm has been a core module for several years now; all the special variables have an English equivalent. See perldoc perlvar. -- JoePepersack?

I would say that Ruby and Perl share a philosophy more than they do features: ThereIsMoreThanOneWayToDoIt. For instance, to print things, you have print, p, puts, $stdout <<, etc. That these all have subtle distinctions only emphasizes the link to Perl. Ruby and PythonLanguage, on the other hand, have many similar features, but Python is much more focused on providing one mainstream way to do things.


After a bit of a look I got the feeling the RubyLanguage is the result of crossing PerlLanguage with SmalltalkLanguage. -- DavidPlumpton

This has been my opinion since day one. Ruby = Smalltalk + Hentai Tentacles (a.k.a. Perl)

My description of Ruby has always been: Smalltalk with enough syntactic sugar that you can make it look like Perl. --RobertFisher


After prolonged use, I got the feeling that Ruby has little to do with PerlLanguage, save the superficial "scripting language" comparisons listed up top. -- JamesBritt

See http://www.rubygarden.org/faq/entry/show/14 for a list of what RubyLanguage lifted from Perl. (It's halfway down the page)

I also got that feeling (after a few months with Ruby). Now that I have looked at SmalltalkLanguage, Ruby feels more like a re-implementation of Smalltalk with Algol-like syntax, file/edit/command-line environment instead of the IDE, and a bunch of Perl functionality thrown in as libraries (RegularExpressions, etc).

That's what I think really 'killed' Smalltalk... the VM/VI model offers a number of interesting advantages, but in a practical sense, it can be very prohibitive. Similar logic explains why the VonNeumann architecture won out over technically sophisticated devices like the LispMachine. (Disclaimer: this is not a knock on either Lisp or Smalltalk; in all honesty, I strongly admire those two and use SBCL under SLIME.) -- TheerasakPhotha
With rubyisms.pm (available from TheCpan), ruby-style blocks are available in perl. By no means does this equate to feature parity, but the style is available at least.


See also ScriptingLanguage
CategoryProgrammingLanguageComparisons CategoryComparisons, etc. That these all have subtle distinctions only emphasizes the link to Perl. Ruby and PythonLanguage, on the other hand, have many similar features, but Python is much more focused on providing one mainstream way to do things.


After a bit of a look I got the feeling the RubyLanguage is the result of crossing PerlLanguage with SmalltalkLanguage. -- DavidPlumpton

This has been my opinion since day one. Ruby = Smalltalk + Hentai Tentacles (a.k.a. Perl)

My description of Ruby has always been: Smalltalk with enough syntactic sugar that you can make it look like Perl. --RobertFisher


After prolonged use, I got the feeling that Ruby has little to do with PerlLanguage, save the superficial
ThreadMess? See KolmogorovQuotient.

EditText of this page (last edited August 23, 2013) or FindPage with title or text search