27 Jul, 2009, Lobotomy wrote in the 1st comment:
Votes: 0
I'm curious to know what the thoughts of those here are regarding the programming languages Python and Ruby, and how they compare with one another. For instance, I hear a number of you singing the praises of Ruby from time to time, and saying things such as it being much better than Python, so I'd like to hear some more detailed explanations of that, and vice versa.

One particular thing I'm personally after in all of this is with regards to built-in support for GUI's. I'm already aware of Python's tkinter, but I'm not aware of what Ruby provides; nor of how those two stack up against each other in that aspect.
27 Jul, 2009, Erok wrote in the 2nd comment:
Votes: 0
I don't have experience with either, but a google search on "python vs ruby" shows that it's been a raging debate for some time. You could read through some of it and make up your own mind.

On the GUI side, another search on "ruby GUI" came up with this (unhappy) article from 12/08 listing various Ruby toolkits that were available at the time. A search on "python GUI" might give you some other Python toolkits to look at as well.
27 Jul, 2009, Lobotomy wrote in the 3rd comment:
Votes: 0
Erok said:
I don't have experience with either, but a google search on "python vs ruby" shows that it's been a raging debate for some time. You could read through some of it and make up your own mind.

This is not a matter of "I'm too lazy to just look it up myself"; I want to hear what the people around here touting Ruby or Python as the end-all, be-all, think.
28 Jul, 2009, Tyche wrote in the 4th comment:
Votes: 0
I think GUI support is pretty much language neutral.

ruby said:
require 'tk'
root = TkRoot.new
TkLabel.new(root) do
text 'Hello, World!'
pack
end
Tk.mainloop

python said:
from Tkinter import *
root = Tk()
w = Label(root, text="Hello, world!")
w.pack()
root.mainloop()
28 Jul, 2009, Erok wrote in the 5th comment:
Votes: 0
Lobotomy said:
I want to hear what the people around here touting Ruby or Python as the end-all, be-all, think.

I don't think absolute claims should be taken seriously, and hopefully nobody here is making claims like that. In all sincerity though, the volume of articles that came up on "python vs ruby" should be a reasonable indicator that there probably is no clear winner when comparing them, and either can get the job done with roughly equivalent effort. The previous post seems to provide a good example of that.
28 Jul, 2009, Runter wrote in the 6th comment:
Votes: 0
I like them both. However, I prefer Ruby. The truth is I'd rather be using Lua, Ruby, or Python for most projects than other languages.
28 Jul, 2009, Idealiad wrote in the 7th comment:
Votes: 0
I've been working with Python rather than Ruby for a few reasons:

* 3rd party game development libraries. From what I've found there seems to be more of these in Python than Ruby. Pygame, pyglet, the Python wrapper of libtcod (a C/C++ textmode library), cocos2D, rabbyt…basically it is very simple to get the framework of a game running. This is not to say there aren't anygame libs in Ruby, there's just not as many choices.

* this is just my impression, but it seems like Ruby is closer to Perl in the sense that 'there are many ways to do something'. Python's approach at least philosophically seems to be 'there should be one way to do something'. I feel more aligned with the latter in terms of paring something down to simple utility.

* 'begin' and 'end' in control flow. A pet peeve but this kind of drives me up the wall. I much prefer Pythonic indentation. So, let the flame war begin. :rolleyes:
28 Jul, 2009, Runter wrote in the 8th comment:
Votes: 0
Idealiad said:
* 'begin' and 'end' in control flow. A pet peeve but this kind of drives me up the wall. I much prefer Pythonic indentation. So, let the flame war begin. :rolleyes:


The 'many ways to do it' comment was fair enough. Although I'll disagree with you.
However, As you already mentioned, there's many ways to do things in Ruby. (Or at least a few). And you're picking what you may believe to be the least attractive way. Pretty sure you don't hate using curly braces as much. It's perfectly acceptable to use.

def meh {
# ruby supports curly braces too
}


I actually like using the do … end notation. (begin isn't correct here.)

I think I'll avoid the language zealotry, though. :)
28 Jul, 2009, Ssolvarain wrote in the 9th comment:
Votes: 0
Python eats ruby. Ruby gets lodged in intestinal tract. Python dies and Ruby is lost in snake guts.

Everyone loses :(
28 Jul, 2009, David Haley wrote in the 10th comment:
Votes: 0
Most of the time, the languages are similar enough that it will come down to libraries (as Idealiad mentioned) or something as "petty" as indentation/syntax preferences (which as we all know can be extraordinarily important to some people). For example, while Lua can do everything Python and Ruby can do, it "suffers" (I use that word carefully, as the Lua authors did this very deliberately) from three main drawbacks: (a) extremely small standard library, and related (b) relatively few community libraries, or at least few consistent standards, and again related © no built-in convention for building classes and objects.

In many ways, Lua's mechanisms for OOP are more general than other languages (although you can implement them elsewhere as well, of course). The point is that it doesn't give you a model you have to follow; you can build your class model on top.

For these reasons I would not heartily recommend Lua as a general purpose programming language; that's just not really what it was designed to do. You can of course write entire MUD servers in nothing but Lua, but you will have to do more work like writing your own collection classes, and in fact writing a class framework to begin with. ("You" here can be yourself or somebody else who wrote a library, that you'd have to go track down and install.) Where Lua excels is in providing a very lightweight (in terms of memory and CPU efficiency) language for constructing domain-specific languages.

This might seem neither here nor there but the point is that IMO Ruby and Python are relatively similar modulo syntactic differences, whereas a language like Lua has its own role to play.

I'm also interested in hearing actual technical reasons for why one language might be "superior" to another (along with the criteria used to establish superiority). For instance, it was thrown out on IMC the other day that Ruby fibers are supposedly superior to Lua coroutines. Claims like these at least can be more readily approached at a technical level, as opposed to one camp hating indentation and the other camp hating do…end blocks – surely we can all agree that the latter is a case of preference very much more than, if not totally instead of, technical differences.
28 Jul, 2009, Runter wrote in the 11th comment:
Votes: 0
DavidHaley said:
For instance, it was thrown out on IMC the other day that Ruby fibers are supposedly superior to Lua coroutines.


They bring a powerful feature to Ruby, but I'm going to say that's an almost certain falsehood. Here's a benchmark I found useful although it doesn't compare to Python or Lua. I like the way Ruby presents concurrency, but there's no doubt it isn't going to be superior in terms of performance to anyone. At best it may just be bringing a feature to the table that it was lacking. (Although 1.8 did have continuations in Ruby. They were even heavier weight.)

http://people.equars.com/2008/5/22/ruby-...

And to save folks some time reading the exercise he mentions:
Quote
”Write a ring benchmark. Create N processes in a ring. Send a message round the ring M times so that a total of N * M messages get sent. Time how long this takes for different values of N and M."
28 Jul, 2009, kiasyn wrote in the 12th comment:
Votes: 0
Runter said:
DavidHaley said:
For instance, it was thrown out on IMC the other day that Ruby fibers are supposedly superior to Lua coroutines.


I said that and I was intending on it being silly. I have used both Lua coroutines and Ruby fibers and enjoy them both ;P
28 Jul, 2009, Kintar wrote in the 13th comment:
Votes: 0
I think that in order to truly answer Lobotomy's original question, we're going to have to ask what he's thinking of doing with the languages. It's my firm belief that one language can never be the One True Language for all projects.

Personally, I like Ruby for rapid prototyping of simple apps, and Python as a scripting language on top of another application, because they each offer things that I find useful in those areas. (Lots of C/C++/Java/Whathaveyou libraries for Python integration vs. Ruby's, in my opinion, more flexible syntax for rapid prototyping.) When it comes to a language to actually write an end product that people will be hacking on and expanding, however, I'm going to go with less of a scripting language, and something that gives me more control over my API (read as: something with strong typing) so that I can guarantee the way people will be interacting with library or utility code that I've written to support the application. Again, though, which strongly typed language I use will vary depending on what I'm doing, and what kind of built-in or third-party libraries will be useful.

Does that help any?
28 Jul, 2009, Chris Bailey wrote in the 14th comment:
Votes: 0
I don't really have anything to toss into the corner of either language, but I would like to mention that Ruby does have some nice game libs.
RubyGame, Rudl, Ruby/SDL, and Gosu just to mention a few, all of which are very well developed.
12 Aug, 2009, exeter wrote in the 15th comment:
Votes: 0
As a matter of syntax, it comes down to personal preference. The respective core languages really don't have any compelling advantages over each other.

OTOH, if the number and quality of libraries available is a consideration, I think Python wins hands-down.

Personally, I choose Python for two reasons:

1. I started using it before I knew about Ruby.
2. In the years since, it's remained fully backward-compatible with my brain.

The fact is, in either Python or Ruby, you can probably hack out a decent base MUD server (that is, just the socket stuff, mudlib, commands and stuff) in 1-2k lines of code or less. It's really six of one and half a dozen of the other.

Edit:

Now, if you *really* want to try something off the wall, you should try coding a MUD in Prolog, Haskell, or Scheme. (Note, those are listed in roughly descending order of off-the-wall-ness.)
12 Aug, 2009, quixadhal wrote in the 16th comment:
Votes: 0
Hmmmm, we have RocketMUD… is there a PocketMUD yet? Might be an interesting comparison.
12 Aug, 2009, exeter wrote in the 17th comment:
Votes: 0
quixadhal said:
Hmmmm, we have RocketMUD… is there a PocketMUD yet? Might be an interesting comparison.


Alrighty, then. I hereby claim the name "PocketMUD" and promise to release some code by the end of the week.
12 Aug, 2009, Lyanic wrote in the 18th comment:
Votes: 0
exeter said:
Now, if you *really* want to try something off the wall, you should try coding a MUD in Prolog, Haskell, or Scheme. (Note, those are listed in roughly descending order of off-the-wall-ness.)

I once coded a small MUD in Prolog as an academic assignment. Thanks for bringing up those traumatic memories.
12 Aug, 2009, quixadhal wrote in the 19th comment:
Votes: 0
Lyanic said:
exeter said:
Now, if you *really* want to try something off the wall, you should try coding a MUD in Prolog, Haskell, or Scheme. (Note, those are listed in roughly descending order of off-the-wall-ness.)

I once coded a small MUD in Prolog as an academic assignment. Thanks for bringing up those traumatic memories.

No.

I just wanted to get the prolog interpreter to say Maybe.
13 Aug, 2009, Runter wrote in the 20th comment:
Votes: 0
quixadhal said:
Hmmmm, we have RocketMUD… is there a PocketMUD yet? Might be an interesting comparison.


I think that's going to be a bad comparison by nature. RocketMUD is a Ruby port of socketmud. As such, it really will be a poor example for a properly made ruby mud.
0.0/37