Is Ruby For Me?

I did have another question because I think I understand Ruby to be
fundamentally different in this way. But perhaps I am wrong. I am
accustomed to Event Driven programming with Delphi. Unlike the early
days of Start at the top and end at the bottom or somewhere in the
middle. How does one envision program flow with Ruby?

TonyDM

On Mon, 2007-22-10 at 10:42 +0900, Tony De wrote:

I have the QBSDK and am working with it. Does anyone know if and if so,
how one would take advantage of the Quickbooks API from Ruby?

I really enjoy using swig as a universal
scripting-language-interface-generator-thingie. It doesn’t make
interfaces that are as efficient as hand-rolled ones, but in most cases
you don’t use scripting languages for run-time efficiency but, rather,
development efficiency. Swig fits the bill for the latter for sure!

Tony De wrote:

I did have another question because I think I understand Ruby to be
fundamentally different in this way. But perhaps I am wrong. I am
accustomed to Event Driven programming with Delphi. Unlike the early
days of Start at the top and end at the bottom or somewhere in the
middle. How does one envision program flow with Ruby?

Event Driven is a “style” of programming. Delphi and Ruby both support a
more fundamental concept - a “paradigm” of programming. Both Object
Pascal
and Ruby are “Object Oriented” languages; they permit you to easily
declare
objects, with data and methods, and to architect a program by arranging
these objects together into object models.

When a program decouples its input events from their effects, this is
“event
driven”. An event enters a program and routes to a terminal method. This
changes the object model in memory, somehow. The next event meets the
object
model in its new state - not its old one.

You are describing the “procedural” style, where the program’s state
depends
on the location of the program’s control flow point, in a long method.
These
are styles, not paradigms. But Event Driven is much closer to OO than to
procedural, and both Delphi and Ruby should be used with short methods,
lots
of objects, and a deep object model.

Stephen Cox wrote:

ruby and rails and a few gems to boot. But of course, you can easily
ruby. Most I’ve tried are seriouslly lacking. Maybe Jruby is the answer?
Well, one of the goals of wxWindows is to have a native look-and-feel on
all the platforms where it runs. Now I don’t have a Mac or a Solaris
box, but I have seen it in action on Windows and Linux. Another nice
thing about wxWindows is that the Scintilla/Scite text editor is part of
the tool set.

i know what I’m about to post doesn’t apply to you. however i think it
might give you an idea “what’s to come with Ruby”.

On the Mac, we have RubyCocoa (
http://rubycocoa.sourceforge.net/HomePage ) a bridge between the Ruby
and the Objective-C languages, allowing you to manipulate Objective-C
objects from Ruby, and vice-versa. It interfaces completly with xCode,
(apple’s development environment IDE). Including Interface Builder (the
GUI builder, similiar to VS’ GUI builder - dragging/dropping objects
onto windows and assigning attributes to each object).

Using this tool, you can write complete cocoa applications using Ruby in
the xCode development environment. See the above link for examples of
projects that have done this.

There’s even a Ruby bridge to Applescript called rb-appscript. Allowing
you to control scriptable Mac OS X applications using ordinary Ruby
scripts. Some are even using this in place of Applesript. You can write
ruby scripts to control iTunes, or QuickTime, or Spotlight, etc, etc.

In the next release of OSX (10.5) Apple is including an updated copy of
ruby and rails and a few gems to boot. But of course, you can easily
install what you want.

I tell you this so you’d have an idea what is going on in Ruby on other
playforms. I am assuming the Windows geeks are following suit. I think
soon, you’ll have more than enough Ruby “bridges” to various Windows
techs and IDE’s.

So hang in there.

What I’d like to see is a real cross-platform graphics tool kit for
ruby. Most I’ve tried are seriouslly lacking. Maybe Jruby is the answer?

Jay L. wrote:

On Mon, 22 Oct 2007 00:29:32 +0900, Lloyd L. wrote:

Ruby cannot be
written in Ruby. Ruby is interpreted and can never run as fast as
Delphi.

Actually, both of these are now/soon-to-be incorrect…

Rubinius (http://rubini.us) is a Ruby virtual machine, and one of its
goals
IIRC is to become self-hosting. Its core libraries are mostly in Ruby
already.

JRuby (http://jruby.codehaus.org) now has its first bytecode compiler;
they’re already working on a second one.

Hooray for diversity!

Ruby can do wondrous things. Making libraries is necessary for any
language to endure. It was not that to which I referred. Delphi is
written entirely in Delphi. When the Ruby compiler is also written in
Ruby, then it will have caught up to Delphi in that respect. I do not
think that this is necessary at all. Ruby does just fine without doing
that.