[Rubyinstaller-devel] Migrate to GCC as soon as possible?

Joao Pedrosa joaopedrosa at gmail.com
Wed Nov 26 02:39:30 EST 2008


Hi guys,

First of all, thanks for working on this installer which is much
appreciated. :-)
It was how I first installed Ruby for instance. :-)

But for a long-time I have also been running Ruby on Linux and left Windows
by itself since then. Every now and then I could be seen testing Ruby
on Windows though, and this is such an occasion.

Today I was testing these versions of Ruby:

ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]

C:\t_\downloads\rubyinstaller\sandbox\ruby_mingw\bin\ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114) [i386-mingw32]

jruby -v
jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-26 rev ) [x86-java]

When building the MinGW Ruby I used git to download the rubyinstaller
scripts and ran it with rake. When it got to the Rubygems part it returned
an error during the "ruby setup.rb [...] c:/path/c:/doubling_path" or something.
I was able to install the Rubygems by running the setup manually for it, though
I am not sure what else I missed from the remaining of the installation scripts.

To test the different Ruby versions, I ran some JRuby benchmark files with each
interpreter to make a rough comparison. JRuby came faster by a good margin,
though JRuby has different setups itself (--client, --server, -X-C)
which influence
the results. In general though, JRuby has closed the gap and generally surpassed
MRI's performance. Second faster came the MinGW Ruby I just built. Only in
third and last came the original OneClick installed Ruby which uses VC6 right?

You can run the benchmarks I ran and see for yourself:
http://svn.codehaus.org/jruby/trunk/jruby/bench/language/bench_colon.rb
http://svn.codehaus.org/jruby/trunk/jruby/bench/bench_regex.rb

They have a bunch of other benchmarks though:
http://svn.codehaus.org/jruby/trunk/jruby/bench/

JRuby could "just work" on unfriendly environments such as Windows while
it has been a pain in the neck all these years to fully support Ruby on
Windows. To top it all, JRuby could run considerably faster than Ruby on
Windows in special.

I have barely used JRuby at all thus far, and it's not a perfect
replacement for
Ruby just yet. For example, JRuby can have a hard time presenting more
friendly error messages which really tell what went wrong, but it's evolving,
improving, and it "steals" the platform infrastructure from Java so
they can focus
on other issues. Also, when testing GUI applications (GTK+), Ruby runs
instantly while JRuby with Swing can take a while longer, though they could
improve it as well. JRuby generally starts slower with more complex
applications,
is that fair to say? :-)

I came to Ruby from Java and a disillusionment with the .NET surge and the
splitting of the developers into worlds. Ruby was meant to be the third way,
but now Java and .NET more than promise to support Ruby. Also, Java and .NET
try to leave the C/C++ world behind for as much as most developers are
concerned.

As I currently see it, instead of having Ruby by itself, the future will bring
Ruby + Java and Ruby + .NET and we will have to deal with that and it will
be a nice problem to have. :-)

See an example of IronRuby:
http://www.valleyhighlands.com/ttc/post/IronRuby-for-the-Newbie.aspx

What worries me is Ruby having its ass kicked by these other implementations
mainly on Windows. I personally think it's just easier to run JRuby on Windows
and in the name of reaching a consensus, JRuby could win as my preferred
platform, at least until Microsoft adopts the GNU tools or .NET + Mono
with IronRuby give Java and JRuby something to worry about.

I guess Ruby on Windows will need to take advantage of the latest improvements
on compilers and whatnot to keep it competitive. If Microsoft's C compiler
builds faster executables it could be better to use it, though MinGW's GCC
could be "fast enough" and even more compatible.

It's high-time something great happens to Ruby on Windows, other than
Java and .NET. :-)

I invite you to run some of the benchmarks found in the JRuby repository.
JRuby can be run in different ways:

# generally opts for a simpler JVM said to be the "client" one:
jruby bench_colon.rb
# found only in the JDK, this one can more aggressively try to optimize:
jruby --server bench_colon.rb
# disables the ruby to bytecode compiler because the interpreter is
fast already:
jruby --server -X-C bench_colon.rb

And compare "stuff".

I extended myself a lot in this post but I continue to be thoroughly thankful
for the work of you guys.

Cheers,
Joao


More information about the Rubyinstaller-devel mailing list