[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How is Ruby the "Perlification" of Lisp?

Griff

1/29/2007 3:53:00 AM

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

May some please elaborate on this?

5 Answers

Bil Kleb

1/29/2007 4:09:00 AM

0

Griff wrote:
> I read that Ruby is the "Perlification" of Lisp or something to that
> effect.
>
> May some please elaborate on this?

Let's see what our benevolent dictator has to say...

http://www.google.com/search?q=matz...

reveals,

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-t...

Regards,
--
Bil Kleb
http://fun3d.lar...

Gregory Brown

1/29/2007 4:09:00 AM

0

On 1/28/07, Griff <grettke@gmail.com> wrote:
> 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. Edward (Ed) Borasky

1/29/2007 4:14:00 AM

0

Griff wrote:
> 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.

--
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blo...

If God had meant for carrots to be eaten cooked, He would have given rabbits fire.


Dido Sevilla

1/29/2007 9:44:00 AM

0

On 1/29/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
> 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-b...

--
???????????????????????
???????????????????????????!
http://stormwyrm.bl...

M. Edward (Ed) Borasky

1/29/2007 2:58:00 PM

0

Dido Sevilla wrote:
> On 1/29/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
>> 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-b...
>
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. :)


--
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blo...

If God had meant for carrots to be eaten cooked, He would have given rabbits fire.