Trouble getting started - some basic questions

Hi,

I have read through a few pages of the list and read what I can on the
internet, but I am struggling to find answers to a couple of very basic
questions. I have just learned ruby using Notepad++ and the windows
package of Ruby 1.9.3. I used to be a systems programmer in assembly
language and C. I have a basic knowledge of .NET and a good knowledge of
Windows. I have IR 1.1 installed with VS 2010.

These questions are what I am confused about:

  1. Can I write a Ruby application that uses .NET for system stuff
    (Windows, forms, networking) and package that as an installation that
    end users can install on their computer without going through the whole
    (for users) Ruby installation rigmarole? i.e. Can I write a GUI
    applications and distribute them with a few DLL’s packaged and a
    requirement for .NET 4?

  2. Is the IR implementation any faster/slower than the standard?

  3. Can Ironruby use JRuby as for the VM? Or maybe that is an irrelevant
    question and I am misunderstanding how IronRuby works?

  4. Is IR with Mono very bloated? I was going to use wxRuby, but it seems
    dead and I am now thinking of working in IR instead.

Basically I am wanting to write simple GUI stuff in Ruby to help me
learn Ruby better and also learn a bit of .NET. I will be using Rails
for my main server app, but I am not moving on to that until I learn
Ruby much better. I have gotten fed up writing console apps and want a
simple way to get some GUI going.

Thanks very much for any help or advice you can give :slight_smile:

Kevin McCaughey

  1. Can I write a Ruby application that uses .NET for system stuff
    (Windows, forms, networking) and package that as an installation that
    end users can install on their computer without going through the whole
    (for users) Ruby installation rigmarole? i.e. Can I write a GUI
    applications and distribute them with a few DLL’s packaged and a
    requirement for .NET 4?

Yes, sorta. While you can technically just have .rb files for your app
and execute those directly, it might be easier to have a C# .exe file
and load the Ruby files from that. That way you can have an .exe for
people to open rather than them having to find the correct Ruby file.
It will also make it easier to do some of the things I mention later
in this email.

A while back I did up a little post on how to get IronRuby working
from a C# app:

  1. Is the IR implementation any faster/slower than the standard?

Not sure, but if you’re using Ruby for a GUI app it doesn’t really
matter which version of Ruby you use: it will be slow or fast
depending on what you’re doing, the difference between the different
Rubies is just noise. If a particular thing is too slow, write it in
C# and expose it to your Ruby code.

  1. Can Ironruby use JRuby as for the VM? Or maybe that is an irrelevant
    question and I am misunderstanding how IronRuby works?

No. IronRuby is Ruby, but running in the .NET VM. JRuby is Ruby, but
running in the Java VM. C Ruby is Ruby, running in the Ruby VM. All of
the languages are the same, just running in different environments.

The difference is when you start using libraries: if you use
System.Windows.Forms, then you can’t use your code in MRI or JRuby
because they don’t have that library (it’s a .NET library). Likewise
if you use C libraries written for MRI, you can’t use JRuby or
IronRuby, and if you use Java libraries then you can’t use MRI or
IronRuby.

  1. Is IR with Mono very bloated? I was going to use wxRuby, but it seems
    dead and I am now thinking of working in IR instead.

Ruby in general uses up a lot more memory than the equivalent C#
program, has nothing to do with using Mono or wxRuby or whatever. It’s
one of the costs you pay to be able to have Ruby’s expressiveness.

From my experience converting code between IronRuby and C# it can be
as much as a 10x difference in memory usage.

Basically I am wanting to write simple GUI stuff in Ruby to help me
learn Ruby better and also learn a bit of .NET. I will be using Rails
for my main server app, but I am not moving on to that until I learn
Ruby much better. I have gotten fed up writing console apps and want a
simple way to get some GUI going.

One thing to note: Rails is a web application framework designed for
building websites, not GUI apps. If you want to build a GUI app, then
you don’t need Rails at all.

Hope this helps!

-Rob

Rob, thanks a million for your very helpful reply - it has really
clarified things for me :slight_smile:

I am writing a server based system but, in addition to the web based
front end (Rails), I want a GUI application which talks to the server. I
am also wanting to play around with GUI programming. I know C# is
probably easier in some respects, but I have really fallen in love with
Ruby and would like it to do some prototyping and for quicker
development of some things. And also just to play with!

Thanks again for your timely reply - I am sat here all day trying to
make my mind up which way to go and you have saved me hours of reading!

Kevin