# Re: String generalization called from JRuby

**URL:** <https://www.ruby-forum.com/t/re-string-generalization-called-from-jruby/57030>\
**Category:** Ruby\
**Created:** [April 6, 2006, 5:49pm UTC](https://www.ruby-forum.com/t/re-string-generalization-called-from-jruby/57030 "2006-04-06T17:49:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charles\_O\_Nutter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/aeb1de/32.png) [@Charles\_O\_Nutter](https://www.ruby-forum.com/u/Charles_O_Nutter)\
**Post date:** [April 6, 2006, 5:49pm UTC](https://www.ruby-forum.com/t/re-string-generalization-called-from-jruby/57030/1 "2006-04-06T17:49:04Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Charles\_O\_Nutter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/aeb1de/32.png) [@Charles\_O\_Nutter](https://www.ruby-forum.com/u/Charles_O_Nutter)\
**Post date:** [April 6, 2006, 6:51pm UTC](https://www.ruby-forum.com/t/re-string-generalization-called-from-jruby/57030/2 "2006-04-06T18:51:06Z")

</div>

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](http://sf.net/projects/jruby) 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.

---

<div class="post-metadata">

**Author:** ![Charles\_O\_Nutter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/aeb1de/32.png) [@Charles\_O\_Nutter](https://www.ruby-forum.com/u/Charles_O_Nutter)\
**Post date:** [April 6, 2006, 6:10pm UTC](https://www.ruby-forum.com/t/re-string-generalization-called-from-jruby/57030/3 "2006-04-06T18:10:43Z")

</div>

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 😉 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 😉 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 😉 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 😉 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 😉

bw,  
Peter
