Ian Bicking: the old part of his blog

Re: Ruby, Python, "Power"

Great article. Following is my suggestions for additions:

Comment on Ruby, Python, "Power"
by Seo Sanghyeon


wait, do you like ipython or not? You say it "completely blows" but then imply that it's better than both the python shell and the ruby shell?

# Bill Mill

I think "completely blows" is mangled idiom intended to mean "completely blows away" or "is vastly superior", which iPython really is.

# David S.

As far as I know, Ruby works by evaluating AST (like Perl). No bytecode, i.e. pyc. This has speed implications.

Being addressed with YARV. I think this is one of the factors that don't actually make much of a difference.

Different GC approach (refcounting and mark-and-sweep) and its implication to C extensions need to be mentioned. Debunk "Python lacks real GC" myth. (Cyclic GC was there... since 2.0!)

Agreed, writing Ruby extensions is a lot easier than writing Python ones. This comes with a downside of course: Ruby's conservative GC isn't guaranteed to collect all objects. (There might be things on the stack which look like object references, but aren't.)

There's plans for having a generational GC in Ruby 2. This ought to help quite a bit with performance if done right.

Jython and IronPython need to be mentioned. I don't know much about JRuby.

JRuby seems stable. It's being used in jEdit for making a lot of magic work magically. Pretty cool stuff. There's a lot of Ruby.NET implementations and I'm working on one of them (getting sponsored by Google's Summer of Code) -- you can eventually expect a break through in that area, but it might still take some time.

Compare to Perl's taint mode.

ruby -T is exactly that. :)

Python includes parser module and compiler package to deal with Python sources. Ruby didn't, last time I checked. Also compare Perl's downright horrible B module -- but at least it's there.

Ruby comes with Ripper in the development branch AFAIK. That's a good way of parsing Ruby source code. There isn't an established and sexy parser framework just yet.

Get IPython which completely blows. One may stil argue irb is a part of core distribution and IPython is not.

Any features that IRB doesn't have?

Distutils. No, gem doesn't count, it is a package manager. (Contrast PHP's PEAR vs. PECL.) For building C extensions, I think distutils got many things right compared to Ruby's mkmf or Perl's MakeMaker, the most important being independence from Makefile. I am not up-to-date on Ruby/Perl for this. Corrections welcome.

Not too experienced here, but it can probably be solved with a custom Rakefile. See http://rake.rubyforge.org/

# Florian Gross

Perl uses bytecode too, actually.

# Alex