Live data from Hacker News

What Pythonistas Think of Ruby

blog.peepcode.com

241–247 of 247 posts

Re: What Pythonistas Think of Ruby

#241
post #240

Earlier quoted context omitted.

> I've used Lisp quite a bit (in fact, I did almost all of my first significant programming in Scheme) and even with that background, I've never bought the claim that Lisp gives you some huge practical syntactical/semantic gain over Ruby's already extremely expressive and extensible syntax. I guess I was hoping to be swayed. Ruby's syntax is hardly extensible at all. All you're doing is changing the default scope wit…

Ruby's syntax is hardly extensible at all. All you're doing is changing the default scope with instance_eval and producing objects with the right intermediate behaviors. You can make some neat little DSLs with this trick, but it's not a real extension to the language. Whatever. The fact is that in Ruby you can easily write a DSL that looks as if it was custom rolled for the domain and task at hand. In fact, you can d…

> Whatever. The fact is that in Ruby you can easily write a DSL that looks as if it was custom rolled for the domain and task at hand. In fact, you can do it so transparently that people begin learning the DSL without learning Ruby (cf. Rails). If that doesn't mean Ruby's syntax is extensible, I don't know what does. (And, yes, I get the difference between Ruby's implementation of DSL support and True Lisp Macros; it's just unclear that the difference matters in any significant semantic way.)

If by "custom rolled" you mean "laden with :symbols, forced into ruby's function invocation structure."

> I thought we were past trying to praise Lisp's features over Ruby's simply by calling Lisp's "real" (where "real" means exactly the same as Lisp's down to the backquotes and preprocessor). That argument is tautological: no language could ever possibly measure up to Lisp with that kind of criteria.

Except that I don't make that claim. Dylan did it just fine. I'm asking for real modification of the syntax tree. I'm asking for a real extension of the parser. It's not tautological and there are examples in the wild of people actually succeeding here without the classic sexpr syntax.

> Raganwald et al seem to have managed just fine...

Dozens of lines to mimic at runtime what compiler extension just allows it, in a far more natural and understandable way. I didn't say it was impossible, I said it was awkward.

> And deriding the brackets is just as meaningless as someone deriding the parentheses in Lisp.

I didn't deride brackets. I said that these complex runtime proxy solutions are hacks. It's like C++ people arguing they have anonymous functions because they can write Functor classes. It's a non-argument, because it's almost certain that you _can_ accomplish it. The question is, "How much extra complexity do I have to introduce in order to make this desirable way of programming possible."

Re: What Pythonistas Think of Ruby

#242

Earlier quoted context omitted.

> It allows for the creation of real Domain Specific Languages and the real extension of lisp for a given problem domain. I think the problem was that until now you weren't giving any examples that explained how Common Lisp macros were giving one any greater ability to do this sort of thing than Ruby. One could say "Ruby allows for the creation of real Domain Specific Languages and the real extension of Ruby for a gi…

> Also . . . I totally understand the desire to keep (non-earth-shattering) performance differences out of the discussion. After all, one doesn't use Ruby to write realtime systems in the first place. The performance of its implementations is simply not impressive. If I've chosen to use Ruby for something, I've already thought about the performance implications and decided that the performance penalties of Ruby as co…

> Well also Lisp macros are more comprehensive. Ruby can only make DSLs that look mostly like Ruby. In Lisp, you can literally drop in a new parser if you really want to.

Much better.

I haven't worked much (almost at all) with macros. How easy/difficult would it be to create a Ruby-esque DSL in Common Lisp? I'm just curious.

> This allows you to inject whole new programming paradigms into your code. If you need a special kind of OO, you can easily create it. This is actually incredibly-hard-borderline-impossible to do in Ruby.

Really? I dunno, I've seen (for example) some really interesting functional paradigm idioms implemented in Ruby, such as a lazy evaluation module.

> Especially when you get into anaphora injection and complex closure manipualtion.

I admit I haven't done "complex closure manipulation" much anywhere. I do use closures from time to time in my code, in a number of languages -- including Ruby. I'm not entirely sure how "complex closure manipulation" would look, actually, so I have no basis for comparison in that regard. I guess I'll just have to take your word for it.

> I had the same reaction this morning when a teenager asked me, "Okay so I get pointers. I get what they are. But they don't see good for anything in the real world." If you find this offensive or dismissive, I apologize.

I don't find it offensive or dismissive. I understand your perspective. I just don't think it helped anyone understand anything. I'm sure it all looks a lot more natural to someone who has done a lot more CL and Scheme coding, but it really doesn't to someone who has pretty much never touched a CL or Scheme macro in his life (or even for me, who has touched them a little). In fact, what Lisp macro experience I have is mostly limited to UCBLogo plus a light sprinkling of R6RS.

> I am simply saying that I think you and I are operating at entirely different levels of abstraction, and bridging that gap is difficult for me.

That's understandable. To some extent for my benefit, and even more so for the other guy's, I decided to explain some of where the gap lies -- so that you might find it easier to bridge. I hope.

Re: What Pythonistas Think of Ruby

#243

Earlier quoted context omitted.

I have yet to see a Ruby "DSL" that didn't feel like Ruby There are some out there though, for eg. FancyRoutes: http://www.railsinside.com/plugins/252-fancyroutes-a-nicer-d...

Really? That's the example you want to use. First thing I see on that page: get / 'orders' >> :orders > :index with route / :slug / 'order' >> :orders do get > :show put > :update end get {'item_images' => :controller} / :image > :show That looks like Ruby all over the place. Yeah, it overloads operator methods more than most Ruby code, but it's very clear that it's Ruby.

I and i think most people would disagree with you because above does not "feel like" Ruby.

Re: What Pythonistas Think of Ruby

#244
I hate this stupids discussions and I have seen many pythonist criticizing ruby..why?...because think ruby is a rival?...I use java and ruby..one reason for never choose python is his fanboy community w close mind and always criticizing the other languages..like java..c# ruby...yes..your language is better and is perfect but not everybody prefer it...if you learned a language only for speak bad of it is better no learn it, when you has a few days using ruby is than understand all thing back it...star type code without parentesis and see it look better and is most readeable (I remember you I come from java), I use a bit python and his syntaxis is good but i don't like all...never I feel good using it (I feel more limited) but I don't writte a article criticizing python, ruby is the language for peoples without limits and free mind, RUBY IS THE MOST ELEGANT LANGUAGE I HAVE KNOW, and is very readeable (no exceeds python but is very readeable) for all other reasons I think python could win the discussion forget this discussions and allow ourselves know new ways to learn and write, this discussion are like the religions discussion, nobody win and only works for create bad ideas for the others...peace and sorry for my bad english, I'm germany

Re: What Pythonistas Think of Ruby

#245

As someone who did nothing but Rails since 06 (two Rails-powered startups, plus some Rails contracting), allow me to explain why I dumped Ruby/Rails and switched to Python/Pylons. Batteries. Ruby is great, but outside of Rails you are on your own. Even basic things like geometry needs to be coded by hand. Python (and almost anything else) simply destroys Ruby when it comes to generic non-web centric libraries. And th…

I never choose python like my script language because I don't like the arrogance of pythonist, more now when everybody knows google use python for everything, in python all is perfect and the other languages are crap, I always read articles like this o like python paradox or any other superficial article where the author try feign know others languages for criticize it with "solid arguments" ruby is a infant and don't try compare his libraries w any other language because It's very unfair, but really my questions is WHY PYTHONIST CONCERNED SO MUCH THE OTHERS LANGUAGES?, why they need type all days a new article explain the good language is python or the bad are all others (like java, c#, ruby, perl) I don't kwnow, please explain me it...and don't say the python hacker are much nicer because they are nicer only inside conversations with others pythonist......

Re: What Pythonistas Think of Ruby

#246

Earlier quoted context omitted.

Those are just the "english-y" DSLs. Not all are attempting to read like english. And even for those that are, the point isn't to be writing in english, the point is to be at least halfway readable to a non-programmer reading over your shoulder.

Okay, but it's not really all that clear that "sum.should == 3" is actually any more readable than "assert(sum == 3)". (Do you really have non-programmers reading code over your shoulder? I can't think of any case in a 10+ year career where that's happened.)

I don't personally use the stuff. :) But I have seen environments where that does happen, and it works pretty well for them.

If you're not doing that, I think they're kind of silly.

Re: What Pythonistas Think of Ruby

#247

Earlier quoted context omitted.

Those are just the "english-y" DSLs. Not all are attempting to read like english. And even for those that are, the point isn't to be writing in english, the point is to be at least halfway readable to a non-programmer reading over your shoulder.

> ... the point is to be at least halfway readable to a non-programmer reading over your shoulder. That's the same argument for filing the serial number off of TDD and calling it BDD: sometime, somewhere, somehow eventually some non-programmer is going to have to maintain source code without a trained professional programmer around to help. I don't get it; FIT's been around much, much longer. What kind of non-develop…

The BDD reference is not just an analogy, it's what these are for. And it's not about non-programmers maintaining the code. Not at all. It's about a business owner and a programmer sitting together and making executable specs together.

I don't really get it, but I'm curious. People I respect swear by it.

Post reply on HN