How is Ruby the "Perlification" of Lisp?

G

Griff

I read that Ruby is the "Perlification" of Lisp or something to that
effect.

May some please elaborate on this?
 
G

Gregory Brown

I read that Ruby is the "Perlification" of Lisp or something to that
effect.

Where did you read this? It'd be helpful if we knew the context of the comment.
 
M

M. Edward (Ed) Borasky

Griff said:
I read that Ruby is the "Perlification" of Lisp or something to that
effect.

May some please elaborate on this?
I don't think it's a particularly accurate or useful characterization of
Ruby, since Ruby started out with something neither Lisp nor Perl was
born with -- "everything is an object", objects, classes and methods.
Ruby is Ruby.
 
D

Dido Sevilla

I don't think it's a particularly accurate or useful characterization of
Ruby, since Ruby started out with something neither Lisp nor Perl was
born with -- "everything is an object", objects, classes and methods.
Ruby is Ruby.

Matz was once quoted as admitting that Ruby is a bad rip off of
Smalltalk or Lisp, that's nicer to people. As someone with a slight
acquaintance with Scheme and Common Lisp I could say that it's a
reasonable characterization. Ruby got the "everything is an object"
idea from Smalltalk, which in turn was greatly influenced by CLOS.
These systems are all described as systems based on the "Right Thing"
or MIT approach to design. Perl on the other hand is the very
embodiment of the "Worse-is-Better" or New Jersey approach to design.
[1] The way I see it, Ruby has become a way to combine both approaches
to get the best of both worlds.

[1] See here: http://www.jwz.org/doc/worse-is-better.html
 
M

M. Edward (Ed) Borasky

Dido said:
I don't think it's a particularly accurate or useful characterization of
Ruby, since Ruby started out with something neither Lisp nor Perl was
born with -- "everything is an object", objects, classes and methods.
Ruby is Ruby.

Matz was once quoted as admitting that Ruby is a bad rip off of
Smalltalk or Lisp, that's nicer to people. As someone with a slight
acquaintance with Scheme and Common Lisp I could say that it's a
reasonable characterization. Ruby got the "everything is an object"
idea from Smalltalk, which in turn was greatly influenced by CLOS.
These systems are all described as systems based on the "Right Thing"
or MIT approach to design. Perl on the other hand is the very
embodiment of the "Worse-is-Better" or New Jersey approach to design.
[1] The way I see it, Ruby has become a way to combine both approaches
to get the best of both worlds.

[1] See here: http://www.jwz.org/doc/worse-is-better.html
OK ... here goes ... my last rant for the weekend :)

The message from Matz Bil Kleb posted:

"Ruby is a language designed in the following steps:

* take a simple lisp language (like one prior to CL).
* remove macros, s-expression.
* add simple object system (much simpler than CLOS).
* add blocks, inspired by higher order functions.
* add methods found in Smalltalk.
* add functionality found in Perl (in OO way).

So, Ruby was a Lisp originally, in theory.
Let's call it MatzLisp from now on. ;-)"


Now let's parse this:

1. Take a simple lisp language (like one prior to CL). OK ... let's go
all the way back to Lisp 1.5, to avoid the MIT - Stanford schism or the
Scheme schism.

2. Remove macros ... OK ... remove s-expression ... WHOA, NELLIE! You've
just destroyed Lisp! Lisp *is* s-expressions, m-expressions, and the
fact that you can code m-expressions into s-expressions and then write
EVAL and APPLY (and later EVALQUOTE, READ-EVAL-PRINT loops, etc. in
Lisp. At this point, about all you have left of Lisp is LAMBDA, unless
you want to count call-with-current-continuation, which came from Scheme. :)

3. Add simple object system (much simpler than CLOS) ... OK ... although
the Ruby object system of classes, objects and methods, single
inheritance, etc., looks to me very much like that of Java without some
of Java's nastier quirks ... it's much cleaner. I think of it as a
pretty much "standard second-generation classes-objects-methods"
structure -- "humanizing" the somewhat raw but revolutionary concepts of
Smalltalk.

4. Add blocks, inspired by higher order functions. OK

5. Add methods found in Smalltalk. OK ... see 3 above.

6 Add functionality found in Perl (in OO way). Well ... About all I've
seen in Ruby that looks like it's directly coming from Perl is regular
expressions, the ability to ignore certain syntactical things like
parentheses whenever possible, constructs like "xxx if yyy", and Perl's
ghastly "$!" variables, which both Perl and Ruby have thankfully
translated into English. And I wouldn't say "in OO way" -- what Ruby has
done is much better than that!

First of all, regular expressions are first-class objects in Ruby, not a
confusing syntactic and semantic half-breed with strings like they are
in Perl. Second, Ruby has reflection and introspection baked right in --
the first versions of Java didn't even have that! And finally, Ruby is
much cleaner in the way it handles the dynamic variable. In Perl, at
least the versions I learned on, variables were essentially stored as
strings until you turned them into something else, for example, by
saying "$a += 0.4;". In Ruby, a variable is a reference to an object,
just like Java.

I think my main point in all this ranting and raving is that, while Ruby
may have "evolved from Lisp" in the thought processes of Matz, the
fundamental core of Lisp -- the things that make Lisp Lisp -- is long
gone in Ruby, and it's a lot easier, for me at least, to think of Ruby
as a happy marriage of the best parts of Java and Perl, with a few
advanced constructs added from the more "theoretical" languages like
Lisp and CLU. And when I try to "think in Lisp" while programming Ruby,
I get a headache. :) For that matter, I get a headache now when I try to
program in Lisp or Scheme. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top