3 ms·
There are plenty of lispers in the ruby world. "Ruby is an acceptable lisp" is a decently common saying. While Ruby's OO is not a verbatim copy of CLOS, it is
by jasonwatkinspdx 9y ago
There are plenty of lispers in the ruby world. "Ruby is an acceptable lisp" is a decently common saying.
While Ruby's OO is not a verbatim copy of CLOS, it is much more versatile than you've described above. The best way to think of it is it's delegation under the hood using a little syntax sugar to resemble classes. It's not multiple dispatch, but methods can be aggregated into modules that can be mixed into classes or objects arbitrarily. Dispatch is dynamic and structural (duck typing). All of this combined with ruby's meta programming features make for an expressive system. It's not restrictive, in fact it runs the risk of the opposite problem, which is people over use the flexibility and write overly magic code that proves difficult to maintain down the road.
- flavio81 9y ago>"Ruby is an acceptable lisp" is a decently common saying. I got excited the first time I read that phrase (i think it was Matz who said it?), but they are very very different languages; for example metaprogramming is a piece of cake in Lisp, while it is something reserved for advanced Ruby users, to put just one example. And for me, metaprogramming is extremely important. In any case, I think i'll give Ruby a second look.
- eropple 9y agoI wouldn't say that metaprogramming is for "advanced Ruby users" at all, FWIW. I find writing dynamic/"unfolding" Ruby code much, much easier than wrangling Lisp macros. It is worth your time.
- cutler 9y agoI just don't get the Ruby/Lisp comparison. How can a language based on OO dot syntax compare with a language based on nested parentheses and homoiconicity? They're worlds apart. Is it lambdas? Python and Javascript have lambdas - so what?