Slashdot Mirror


Lisp and Ruby

sdelmont writes "The developers of Rubinius, an experimental Ruby interpreter inspired by SmallTalk, have been discussing the possibility of adding a Lisp dialect to their VM. Pat Eyler collected some ideas and opinions from the people involved and it makes for some interesting reading. For many, Ruby already is an acceptable Lisp, and the language itself started as a 'perlification' of Lisp (even Matz says so) so it is perhaps fitting and might help explain why the whole idea feels right. Now, if someone added support for VB and gave it the respect it deserves, the world would be a better place."

5 of 336 comments (clear)

  1. wow, I have no idea what that just meant! by tommyhj · · Score: 5, Funny

    This is just one of those stories that us non-linux, non-programmers have absolutely no idea of what means! Which insidentally makes it rather funny to read :-) I mean, adding Lisp to Ruby's SmallTalk?

  2. Re:Genuine question about perl vs ruby by Jonathan · · Score: 5, Informative

    1) Object Orientation is consistent throughout the language. Perl provides ways to make objects, but none of the built in functions or datatypes are objects, making your code a schizophrenic mess of objects and non-objects.

    2) Consistency -- In Perl it is needlessly difficult to do ever simple tasks like making arrays of arrays or arrays of hashes -- you have use a weird syntax to get at references. I never could remember it and always had to look it up whenever I needed an array of arrays in Perl. In Ruby, everything is a reference to an object so you don't have to worry about it -- a[0] = [1, 2] does exactly what you want -- puts an array [1, 2] in the first element of array a.

    I used to be a big Perl fanboy -- I did most of my programming in Perl from 1992-1999. But when I discovered Ruby I went for it and never looked back. What's cool about it is that its syntax is so clean that it is basically a version of the pseudocode I have in my head. In the Ruby community there's a phrase for it -- "the principle of least surprise" -- things just work.

    Obviously, if you really like Perl, nothing is going to make you change. But if you are just keeping with Perl because of inertia, then you ought to look around at other scripting languages. Ruby is my favorite, but most modern scripting languages are cleaner than Perl.

  3. Because you'll end up at Lisp. by Anonymous Coward · · Score: 5, Insightful

    What most people don't realize is that Lisp is the inherent representation of virtually all programming languages. This is even true for languages like C, Java, Smalltalk, and Ruby. We can plainly see this by the very fact that basically every compiler or interpreter for those languages parses the language into an abstract syntax tree. And that's exactly what Lisp is: a textual representation of an AST. It is so powerful because it directly allows the programmer to access and modify what amounts to the AST of his or her program. This is something that a language like C isolates to the compiler, or at best the preprocessor.

    What fewer people realize is that Smalltalk is Lisp with a slightly different syntax. The concepts are basically identical, however. So suppose the Ruby developers do all the hard work needed to switch their language over to a Smalltalk-like syntax. Do you know what will happen next? They'll ask themselves what could be improved next. And the first thing that'll happen is a consideration of making the syntax and semantics of the language more Lisp-like. And that's just because Lisp represents the most inherent aspects of what a programming language is.

  4. Re:Performance, anyone? by ravenlock · · Score: 5, Insightful
    If I build a new and presumably better (in my own opinion) programming language starting off with Lisp, and my implementation turns out to be less powerful and slower than an average CL implementation, is that progress?

    It is if it helps introduce the concepts behind Lisp to a lot of people who never would have dared to venture into Lisp otherwise. Ruby was the first language with functional constructs I tried (very much due to the excitement around Rails). Now I'm reading up on Lambda Calculus and learning Haskell, and I'm not at all sure it would have happened, were it not for Ruby.

  5. Re:I use Common Lisp because of its 'white hot' sp by Not_Wiggins · · Score: 5, Insightful
    The problem is that Ruby has very poor runtime performance.

    Not so much in response to the post, but to add to it...
    I'm not that old, but I remember the same being said for:
    • C++ compared to C
    • Interpreted compared to Compiled
    • Java compared to C++
    • Servlets compared to CGI
    The list could continue. Just wanted to highlight that "performance" is a short-lived reason to avoid a language. 8)
    --
    Diplomacy is the art of saying, "Nice doggie!" until you can find a rock.