Ruby vs. Lisp

Yesterday, I wrote about Steve Yegge's The Emacs Problem post in which he examined a claim by a colleague that, among other things, Emacs should be rewritten to use Ruby as the interpreter. Today, serendipitously, I came across Learning Ruby, and Ruby vs. Lisp by Hans Hübner on his Netzhansa blog. Hübner is a Lisper who works in an environment where there is a lot of Ruby development going on and he decided to learn a bit about it. After reading The Ruby Programming language by David Flanagan and Yukihiro Matsumoto and doing a bit of programming, he could see the appeal or Ruby but felt that it didn't offer him anything that Common Lisp didn't have and that Ruby had some problems:

  • Ruby strives for succinctness but often at the cost of complex syntax and special case rules to resolve ambiguities.
  • Ruby's functional programming aspects appear to have been bolted onto its original object oriented model after the fact. This makes using Ruby in a way that is not pure object oriented messy and hard to understand.
  • Ruby runs about 10 times slower than the same program in CL.

Yegge likes Ruby too but he believes it falls into the category of “scripting languages” by which he means “a bunch of miserable hacks: Perl, Python, Ruby, Groovy, Tcl, Rexx… you name it. They all start life with no formal grammar or parser, no formal bytecode or native-code generation on the backend, no lexical scoping, no formal semantics, no type system, nothing. And that's where most of them wind up.1” That's harsh, of course, but it does help explain all the warts in the language.

Incidentally, despite these complaints, Yegge is very complimentary about Ruby in his Tour de Babel post about programming languages. He considers it Perl done right and believes that it will largely displace Perl. Yegge didn't seems to be fazed by the complex syntax that bothered Hübner and said that it usually works the way you expect it to.

Ruby has a lot of devoted fans and I've often been tempted to learn it but it seems to me that it solves pretty much the same problems that Lisp and Scheme do and I'm very happy with those languages so I'm still not ready to take the plunge. Maybe next week.

Update: phased → fazed

Footnotes:

1 The last comment in his The Emacs Problem post.

This entry was posted in Programming and tagged . Bookmark the permalink.
  • phased

    *fazed

    • jcs

      Yes. Fixed, thanks.

  • qwerty

    Since when does Ruby not have a type system or lexical scoping?