3 ms·
First of all, thank you very much for your informative reply on the implementations. >I'm unsure what you mean by this. I believe that any OOP system that wan
by flavio81 9y ago
First of all, thank you very much for your informative reply on the implementations.
>I'm unsure what you mean by this.
I believe that any OOP system that wants to be flexible, modern, and powerful, should have most of the features that CLOS (Common Lisp Object System) has. Julia (language) did, for example.
It would be lengthy to explain all the features and benefits of CLOS here, but in CLOS, methods are not tied to objects, and all methods do multiple-dispatch. This also allows doing OOP in a functional-like way (this is easier to understand once you see how CLOS works.)
In comparison, most other OOP systems feel limited and restrictive, and very different from CLOS.
>a good deal more flexible than Python's
Probably, but OTOH Python's OOP system is perhaps one of the weakest OOP systems out there, and speaking from my 2 years of professional experience with Python. I find it acceptable, but not good.
- jasonwatkinspdx 9y agoThere 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?