Re: String generalization called from JRuby

Forking the discussion a bit, but I’m interested in your use of JRuby
here.
It seems like a great idea to have little snippits of code that are
easier
to understand and maintain in Ruby, and be able to call them from Java
with
JRuby. Are you doing this already, or is this a first possible attempt
at
it?

(I ask because I’m on the JRuby team)

Excellent, then we are working toward similar ends: the invasion of the
Java
world by Rubyists. Please feel free to ask questions on the JRuby
mailing
lists at JRuby download | SourceForge.net and let us know how things are working
out
for you. The compatibility issue is one of special concern for us…we’d
like to be able to run everything Ruby out of the box, and perhaps this
is
not something Jython can claim today.

Howdy,

Charles O Nutter wrote:

Forking the discussion a bit, but I’m interested in your use of JRuby here.
It seems like a great idea to have little snippits of code that are easier
to understand and maintain in Ruby, and be able to call them from Java with
JRuby. Are you doing this already, or is this a first possible attempt at
it?

Well, this will be my first attempt at JRuby - but this should not mean
anything, as i begun to work with Ruby 2 weeks ago :wink: Nevertheless i
can answer your question: I did this with Jython and i liked it. (I do
not really like to code in java, (i prefer dynamically typed languages
over statically typed ones) i am just doing it because i am working on a
big project which is written in java.) So as soon as i can (and it makes
sense) i am rushing to Jython/Jruby. (actually i like Ruby much more
after 2 weeks than Python after 2 years :wink: So i will go with JRuby in
the future. Actually JRuby is a clear winner in the compatibility issue
imho (against Jython, which is faaaar from being Python2.4 compatible)

I think it is absolutely cool to do everything in JRuby which makes
sense (i.e. to open a file, i will not go to JRuby - although after 5
years as a Java professional i have to still look up the doc on how to
open a file every time - not kidding here - so maybe this is not a bad
idea either :wink: but operations which require string manipulation,
regexps, lists, hashes, slicing, metaprogramming, can leverage blocks
etc just to name a few are defintely ideal to be “outsorced” to JRuby.
Another ideal case is when the input and the output are both something
simple (e.g. String -> String) - i.e. they are not depending heavily on
non-built-in java objects.

My only problem is, that my other colleagues (and the company in
general) is java only (although i am heavily sowing the seeds of Ruby
also here :wink: and thus they do not really like the idea that someday
they could possibly have to maintain Ruby code. So i am infiltrating our
codebase slowly (and hope to reach a point one day where most of the
code will be in Ruby :wink:

bw,
Peter