OK, you trolled me
First, please let me apologize for the many errors and
inconsistencies
in my post. It may be that many of the things I am
going on about
are actually fixed/about to be fixed/not really
broken, in which case
I would be ever so glad to have my error pointed out
to me. Also let me
apologise for not knowing who Andy Roonie is.
<Zeppelin-packed rant about Perl (which I completely
agree with) snipped>
Going back to Parrot, I place higher chances of Matz
finishing Rite
(Ruby + VM) than I do of Parrot actually taking
flight.
But Parrot is a functioning, usable,
kinda-sorta-feature-complete
virtual machine whereas Rite is, well, imaginary.
Perhaps Iâll install it
on some imaginary servers.
Iâve
already moved on from the fame that was Perl and have
embraced my new
mode of transportation. Rubyâs slick, fast, and
feels like driving a
new BMW after years of a beat up, run down Mustang.
Rubyâs not perfect mind you, but it has the elegant
design and
ingenuity behind it that makes me believe that one of
these days,
itâll get there. What really excites me about Ruby
and its future is
that it will do so elegance and with class.
::shrug:: I donât know
about you, but I think wings and a vertical take off
would be damn
slick on a BMW, donât you?
I donât think the BMW analogy is terribly good. I
would prefer the
following: if Perl is like a Mustang, Ruby is like a
detailed plan of a
BMW.
I have been using (or trying to use) Ruby since Before
It Was
Famous â˘, and I have made countless attempts to
convince people
how great it is (which almost always succeed) and
countless attempts
to get it used in a real world project (never
succeeded yet). The
conversations tend to go the same way each time. In
order to explain
why I donât get the BMW analogy, please let me
summarize those conversations
in the form of a dialog between an Enthusiastic
Convert To Ruby, and a
Wise, Prudent Software Engineer.
ECTR: âRuby has the power and scalability of an OO
language, the flexibility
and elegance of a functional language, and the useful
text-munging abilities
of Perl.â
WPSE: âOkay, I believe you. Letâs use it for text
processing. I guess thereâll
be no problem with international data.â
âWell, no. As long as itâs Japanese, and in EUC,
Shift-JIS, or UTF-8. Thereâs
a single global variable in your program that you have
to set correctly before
using a given string.â
âThe data is in UCS2, like Windows, Java, and COM use.
The Solaris stuff is in
UCS4 because they just had to use wider characters
than NT. Are you telling
me Ruby wonât handle that?â
âWell, youâll need to compile in a special module.
And you should bear in mind
that input from the console will be in Shift-JIS,
whatever your other strings
are like. Ruby does not try and access the OSâs
character conversion services,
so if a new encoding comes along you might have to
deal with it yourself.â
âI⌠see. Well, when this HAS been done, I take it
we can process the text
normally? regexes work on wide characters, right?â
âEr, no. There is some special code that makes most
operations work on
the three encodings I mentioned, but otherwise itâs
all a bit difficult.
Now that I think of it, even in those three encodings
you canât even get the
character length of a string.â
âWhereas length() in perl has returned the correct
answer since version 5.0.â
âYes. Ruby can use UTF8 strings, like Perl, but the
assumption that a string is
an array of bytes is deeply embedded in the language.â
âSo⌠when you said âtext processingâ you meat âtext
processing in exactly four
different possible encodingsâ. Not âtext in generalâ.
Not even âJapanese
and English text in generalâ. Just EUC --â
âActually, I should mention that in this case EUC is
only EUC-JP. EUC-KR wonât
work.â
âI see. I assume, by the way, that Ruby WILL be able
to process text â
meaning at least to use UCS2 or UTF8 internally â in
the near future?â
âWell⌠it was scheduled for 2001, but there hasnât
been any information for a
long time.â
âRight. Well, I guess weâll carry on with Perl on the
server, but maybe
we can deploy Ruby on the Windows desktops. We could
do with a powerful
scripting environment on those things. Is there an
ActiveState version?â
âNo. ActiveState expressed interest in producing a
Windows distribution quite
a while back, but⌠well, it didnât happen. There is
a Windows binary
distribution, though.â
âGood! Letâs just check if the database support works
right, and then --â
âEr, actually itâs a distribution that doesnât have
any database support. You
would have to install a package called RDB⌠and then
you would have to install
an appropriate database driver for it. Thereâs an
ODBC one that you can get a
binary of from some page in Japan, or if we have a
copy of gcc we canâŚâ
âSo there is no standard Windows distribution that
contains even such basics as
the ability to talk to a database?â
âThere isnât really a âstandardâ per se at all.
Actually thereâs a bit of a
split between native windows and cygwin, still.â
âI⌠see. I assume, of course, that a standard
Windows distro that puts a
predictable Ruby version with database support on a
userâs desk is coming up
soon.â
âWell⌠the creator of Ruby has specifically
indicated that he isnât interested
in Windows support, but people are always making
noises about itâŚâ
âRight. Well, heck, I guess we can carry on using
Perl on the desktops too.
I tell you what, though, we might still use Ruby for
some large application that
doesnât need to interact with the outside world much.
Rubyâs clean OO structure
should make multithreading pretty easy.â
âIt doesnât do multithreading. It has what you would
call âfibersâ, but they
are not true threads. If you perform a blocking
operation, the whole program
blocks. The trouble is, the Ruby code assumes one
Ruby machine per process so
itâs hard to roll your own multithreaded Ruby.â
âWell, how on earth do you use it in a web server,
then?â
âYou remember Apache version one?â
âOkay, I guess weâll keep using Java for that sort of
thing, much as we loathe
it. I assume that work is under way to create a
threadable, embeddable,
flexible Ruby engine or VM?â
âYes. At least, sort of. There has never really been
any information
about it. The last comment from the Creator was âI
can promise nothingâ.â
âAnd the Windows distribution?â
âAgain, itâs hard to say either when or if.â
âAnd the text processing? The basic fundamental
ability to handle a string
without someone having to remove all the difficult
bits first?â
âAgain, thereâs not really any hard information.â
âOkay. Well, I think Iâve decided on a Ruby strategy,
based on the principles
of Pragmatic Management. Let me run it by you. Tell
me what you think.â
âOkay.â
âFirst, get the hell out of my office. Second, hire
another Perl programmer,
itâs a skill thatâs going to last forever.â
Thank you for reading this far. I know that other
peopleâs experiences may
vary, and that some sites may be able to assume that
all text is ASCII or
that all windows installations can be personally
looked after. However, these
three issues (text, Windows, threading), of which the
most important by far is
the text issue, have basically prevented Ruby from
being used at any site I have
worked at. Including sites in Japan. Even though there
were many people who
liked it and wanted to use it.
This in itself, however, is not really a problem. If
Ruby isnât aimed at
people who need internationalization, then so be it â
itâs free, after all.
The problem is more the lack of information on when,
if ever, things will
change, which makes it difficult to reccommend Ruby
with confidence. It is
difficult to make Ruby seem like a good investment â
or even
like a properly run software project â when the main
channel for information
is the occasional laconic epigram from matz.
Questions like:
âWhat is the status of Rite?â
âWhen will we know what rubyâs i18n support will
consist of when it arrives?â
âWhen will 1.8 be available and what will be in it?â
simply cannot be answered and as a result it is hard
for Ruby to appear
credible outside of the lone developerâs workstation.
I would like to make it clear that I am not
complaining nor demanding these
features. I just think that many in the Ruby
community do not realise how
far Ruby is from being as useable as Perl, both in
terms of functionality
and in terms of confidence-inspiring,
management-appeasing information about
whatâs going on.
Benjamin Peterson
x