[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[FWP] Anybody look at Ruby? (was Re: Perl Moral Support)



2000-03-16-17:03:39 Ofer Inbar:
> I was a burned out programmer, until perl.

I gotta confess that I didn't get burnt out before switching to
perl, but I was starting to get frustrated at the tedium of
assembling large, complex systems that made rich use of supporting
libraries, in C, while keeping the whole mess portable. Prior to
ANSI C that was amazingly frustrating, now years after ANSI C it's
no better (but there's autoconf to lean on:-).

But perl is so liberating and expressive that it is excruciating to
stoop to any other language, it takes so much more effort to say
anything interesting.

Except, maybe, Ruby?

I'm taking a good look at Ruby for the first time. It's got a _lot_
of features swiped gracefully from perl, enough so that many of the
idiomatic ways of structuring code to say what you want are just as
sweet and clean in Ruby.

I just stumbled across the thing that might get me to switch for
real: it uses exceptions for all error reporting. Which means, if
you want the program to print an error message and die if something
goes wrong, just ignore the possibility and that's the default
behavior. I like that in a programming language. Quick-n-dirty
throwaways should check for errors. When you want to try and do
something to recover from an error --- including just ignoring it
--- say so, but if you ignore 'em they shouldn't just sleaze on
past.

But it has some other cool bits, too. It's pretty well completely
O-O; all the builtin utility operations are methods for the builtin
types; the standard, default numeric type is a bignum (or else
overflows automatically and gracefully into bignums, I don't
know:-). The standard flow of control operators are just syntactic
sugar for generalized iterator operations on the standard types, and
you can easily implement your own iterators.

I realize that this posting isn't necessarily on-topic for fwp. But
I think language design and comparison is pretty entertaining, and
if there's some good stuff we need to swipe from Ruby, well, let's
see if we can swipe it.

-Bennett

<URL:http://www.ruby-lang.org/en/>
	The main Ruby home, in English

<URL:http://www.math.sci.hokudai.ac.jp/%7Egotoken/ruby/ruby-uguide/>
	An intro guide, not quite perfectly idiomatic translation
	from the Japanese, but still good enough to be quite helpful
	for dipping your toe in the waters.

PGP signature