Choosing ruby?

We are on the way to start a new project, a web application with a bunch
of pages and the following features:
*) users are maintained within a persistent repository (it could be as
easy as a yaml file, we are talking about no more than 10 users); first
page is a login page, of course
*) through these pages (around 10, warning & error pages included) a
user can invoke a transaction on a legacy system ==> we already have
java code that encapsulate a transaction or we can rewrite it in ruby,
it is a simple text based protocol over sockets, just like a telnet session
*) some transactions may not be invoked directly through the webapp, but
they are scheduled instead for late night execution; of course, we can
store these info in a yaml file too, there is no real need of a
relational db
*) we are talking initially about 2-3 transactions per day (not very
hard, isnt’it?)

We have an (almost-)ready framework in java for building webapps.
Although that, we are asking ourselves if developing in ruby could be a
better choice, mainly in terms of development speed. Infact, having
around 2 or 3 transactions per day I don’t think that application speed
really matters (as long as users will not complain). We are just ruby
newbies, but we like it. We are considering perl too, because in our
team there’s a perl fan, sponsoring mason for this project.

We can develop:
*) everything in java
*) mix ruby (html-based frontend, maybe fastcgi or mod_ruby) and java
(transaction invocation)
*) everything in ruby,
*) mix perl and java (we have tried a 30’ spike with Inline::Java, it
seems to work)
*) everything in perl.

If we mix ruby & java I was thinking about using rjni or rjava.

One thing to take into account is that the application will be deployed
on a Sun cluster (5500, I guess) and I am not sure that the customer
will permit to compile the ruby interpreter there. They are quite
"conservative", if you know what I mean.
I know that this depends on os version, but may I expect to find in any
"official" place an already compiled interpreter for Solaris /whatever/?
This thing may affect negatively the whole choice. Unfortunately the
customer is pretty rigid on things like that.

Apart from that, development speed is the most important thing in this
project: not very comfortable, but sometimes you have to do it. Even if,
or because of we are quite in a rush we follow an XP process, applying
the whole set of practices like TDD, continuous integration, small
releases, etc. We don’t want just to hack some code together. We are
quite experienced in java, a lot less in ruby, and even less in perl,
but with the latter we have at least an experienced person.

I’m sharing this with you both for hearing your opinions and for letting
you understand which kind of silly things may encourage or prevent ruby
adoption.

Thanks!
Giuliano

···


If you want to send me an email in the address you have to write ‘p’,
then a dot, followed by ‘bossi’ at ‘quinary’, another dot and ‘com’ at last

“Piergiuliano Bossi” p_bossi_AGAINST_SPAM@tiscali.it schrieb im
Newsbeitrag news:bv5moi$q2a$1@lacerta.tiscalinet.it…

We are on the way to start a new project, a web application with a bunch
of pages and the following features:
*) users are maintained within a persistent repository (it could be as
easy as a yaml file, we are talking about no more than 10 users); first
page is a login page, of course
*) through these pages (around 10, warning & error pages included) a
user can invoke a transaction on a legacy system ==> we already have
java code that encapsulate a transaction or we can rewrite it in ruby,
it is a simple text based protocol over sockets, just like a telnet
session
*) some transactions may not be invoked directly through the webapp, but
they are scheduled instead for late night execution; of course, we can
store these info in a yaml file too, there is no real need of a
relational db
*) we are talking initially about 2-3 transactions per day (not very
hard, isnt’it?)

We have an (almost-)ready framework in java for building webapps.
Although that, we are asking ourselves if developing in ruby could be a
better choice, mainly in terms of development speed. Infact, having
around 2 or 3 transactions per day I don’t think that application speed
really matters (as long as users will not complain). We are just ruby
newbies, but we like it. We are considering perl too, because in our
team there’s a perl fan, sponsoring mason for this project.

We can develop:
*) everything in java
*) mix ruby (html-based frontend, maybe fastcgi or mod_ruby) and java
(transaction invocation)
*) everything in ruby,
*) mix perl and java (we have tried a 30’ spike with Inline::Java, it
seems to work)
*) everything in perl.

If we mix ruby & java I was thinking about using rjni or rjava.

One thing to take into account is that the application will be deployed
on a Sun cluster (5500, I guess) and I am not sure that the customer
will permit to compile the ruby interpreter there. They are quite
“conservative”, if you know what I mean.
I know that this depends on os version, but may I expect to find in any
“official” place an already compiled interpreter for Solaris /whatever/?
This thing may affect negatively the whole choice. Unfortunately the
customer is pretty rigid on things like that.

Apart from that, development speed is the most important thing in this
project: not very comfortable, but sometimes you have to do it. Even if,
or because of we are quite in a rush we follow an XP process, applying
the whole set of practices like TDD, continuous integration, small
releases, etc. We don’t want just to hack some code together. We are
quite experienced in java, a lot less in ruby, and even less in perl,
but with the latter we have at least an experienced person.

Considering all this I’d recommend to go for plain Java. Reasons:

  • you’re quite proficient in Java

  • the JSP / Servlet framework is there and not really
    difficult to understand (IMHO) if you know web app
    basics (HTTP, HTML, control flow etc.) In your case
    that seems sufficient, no need for some fancy web
    app framework (don’t use Struts)

  • not mixing languages means saving yourself a lot of effort and
    a huge source of bugs

  • you might not even be allowed to use Ruby
    (because of interpreter compilation)

Next would be Ruby since it is IMHO more easily learned than Perl and
there are webrick, eruby and others.

I would not consider Perl since you don’t benefit in this situation:
Learning Ruby is easier and you don’t need the additional speed that Perl
exposes over Ruby for some applications.

Kind regards

robert

Thanks to everybody for your valuable feedback.

We have decided to go for java, using Velocity indeed (our own framework
is based on Velocity).

I entirely support the idea of having some working mechanism for
ruby-java integration, even if not entirely mature.

Having precompiled binaries of ruby interpreter for several platforms is
an issue that may have impacts on a future choice. Is there anything we
can do for that, as a community?

Ciao, Giuliano

Piergiuliano Bossi wrote:

···

We are on the way to start a new project, a web application with a bunch
of pages and the following features:
*) users are maintained within a persistent repository (it could be as
easy as a yaml file, we are talking about no more than 10 users); first
page is a login page, of course
*) through these pages (around 10, warning & error pages included) a
user can invoke a transaction on a legacy system ==> we already have
java code that encapsulate a transaction or we can rewrite it in ruby,
it is a simple text based protocol over sockets, just like a telnet session
*) some transactions may not be invoked directly through the webapp, but
they are scheduled instead for late night execution; of course, we can
store these info in a yaml file too, there is no real need of a
relational db
*) we are talking initially about 2-3 transactions per day (not very
hard, isnt’it?)

We have an (almost-)ready framework in java for building webapps.
Although that, we are asking ourselves if developing in ruby could be a
better choice, mainly in terms of development speed. Infact, having
around 2 or 3 transactions per day I don’t think that application speed
really matters (as long as users will not complain). We are just ruby
newbies, but we like it. We are considering perl too, because in our
team there’s a perl fan, sponsoring mason for this project.

We can develop:
*) everything in java
*) mix ruby (html-based frontend, maybe fastcgi or mod_ruby) and java
(transaction invocation)
*) everything in ruby,
*) mix perl and java (we have tried a 30’ spike with Inline::Java, it
seems to work)
*) everything in perl.

If we mix ruby & java I was thinking about using rjni or rjava.

One thing to take into account is that the application will be deployed
on a Sun cluster (5500, I guess) and I am not sure that the customer
will permit to compile the ruby interpreter there. They are quite
“conservative”, if you know what I mean.
I know that this depends on os version, but may I expect to find in any
“official” place an already compiled interpreter for Solaris /whatever/?
This thing may affect negatively the whole choice. Unfortunately the
customer is pretty rigid on things like that.

Apart from that, development speed is the most important thing in this
project: not very comfortable, but sometimes you have to do it. Even if,
or because of we are quite in a rush we follow an XP process, applying
the whole set of practices like TDD, continuous integration, small
releases, etc. We don’t want just to hack some code together. We are
quite experienced in java, a lot less in ruby, and even less in perl,
but with the latter we have at least an experienced person.

I’m sharing this with you both for hearing your opinions and for letting
you understand which kind of silly things may encourage or prevent ruby
adoption.

Thanks!
Giuliano


If you want to send me an email in the address you have to write ‘p’,
then a dot, followed by ‘bossi’ at ‘quinary’, another dot and ‘com’ at last

I’m sorry to have to tell you that rjni is at best alpha :frowning:
I’ve got a nearly feature-complete version in my local repository but I
haven’t released it, since I don’t see myself spending much time on
it in the near future, and I don’t want to mislead anybody into
thinking so.

···

On Tue, Jan 27, 2004 at 10:29:56PM +0900, Robert Klemme wrote:

If we mix ruby & java I was thinking about using rjni or rjava.


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

The most important design issue… is the fact that Linux is supposed to
be fun…
– Linus Torvalds at the First Dutch International Symposium on Linux

I would recommend Ruby wherever appropriate, but in this case, I agree
with Robert. His list of reasons was sound, I won’t repeat them.

The only thing I would disagree with in his recommendation, is that you
should use an app framework - but not a fancy one. Struts is too
bloated for small apps and too big a learning curve. But having
something to easily do validation and unmarshalling of request
parameters is useful.

I’d use maverick with throwaway controllers and velocity instead of
struts and jsp.

http://mav.sourceforge.net

-don

···

Considering all this I’d recommend to go for plain Java. Reasons:

  • you’re quite proficient in Java

  • the JSP / Servlet framework is there and not really
    difficult to understand (IMHO) if you know web app
    basics (HTTP, HTML, control flow etc.) In your case
    that seems sufficient, no need for some fancy web
    app framework (don’t use Struts)

  • not mixing languages means saving yourself a lot of effort and
    a huge source of bugs

  • you might not even be allowed to use Ruby
    (because of interpreter compilation)

Next would be Ruby since it is IMHO more easily learned than Perl and
there are webrick, eruby and others.

I would not consider Perl since you don’t benefit in this situation:
Learning Ruby is easier and you don’t need the additional speed that Perl
exposes over Ruby for some applications.

Kind regards

robert

I am trying to use the OCI8 driver for Oracle with dbi to do some very,
very simple stuff:

i.e. select member_id from member where email = ?

I’m getting an error from the driver:

Not supported type (Array)/opt/ruby/lib/ruby/site_ruby/1.8/oci8.rb:360

What is blazes does this really mean? How do I make it go away so that I
can just do my very simple little queries and get on with having a happy
life?

Kirk Haines

“Don Dwoske” ddwoske@yahoo.com schrieb im Newsbeitrag
news:moednYyJToYT8ovd4p2dnA@comcast.com

I would recommend Ruby wherever appropriate, but in this case, I agree
with Robert. His list of reasons was sound, I won’t repeat them.

Thanks! :slight_smile:

The only thing I would disagree with in his recommendation, is that you
should use an app framework - but not a fancy one.

Exactly. Well, it depens on what you cann an “app framework”. A servlet
container does a lot of what one might expect from a framework. But,
yeah, it should be lightweight.

Struts is too
bloated for small apps and too big a learning curve.

Exactly.

But having
something to easily do validation and unmarshalling of request
parameters is useful.

With Java the Servlet Container (aka Tomcat) takes care of marshalling and
unmarshalling data. Plus you need some library that can handle multipart
POSTS (also available from apache.org).

Validation is another story, but that’s usually easy in a Servlet given
the size of this webapp.

I’d use maverick with throwaway controllers and velocity instead of
struts and jsp.
http://mav.sourceforge.net

I don’t know maverick, but I’d like to comment on velocity. For the last
webapp we did we evaluated velocity, too, but came to the conclusion that
JSP is the better choice:

  • better integrated, all the nifty details are
    already handled by the servlet container, i.e.,
    you don’t need to write your velocity servlet,
    you don’t need to take care of modification
    checks for the templates

  • JSP’s are compiled into classes

  • better performance (your mileage may vary)

  • with upcoming JSP spec 2.0 and Tomcat 5 support for
    expressions all over the page, which means quite
    convenient JSP coding (no need for
    <c:out value=“${fancyExpression}”/> but instead
    ${fancyExpression}

Kind regards

robert

Mauricio Fernández batsman.geo@yahoo.com wrote in message news:20040127135223.GB13801@student.ei.uni-stuttgart.de

If we mix ruby & java I was thinking about using rjni or rjava.

I’m sorry to have to tell you that rjni is at best alpha :frowning:
I’ve got a nearly feature-complete version in my local repository but I
haven’t released it, since I don’t see myself spending much time on
it in the near future, and I don’t want to mislead anybody into
thinking so.

Please do release it. Perhaps you won’t be having time to work on
it in the future, but others may want to work on it. In fact if you
don’t think you’ll be having time to work on it that’s all the more
reason to ‘release it into the wild’ so that others can build upon
your foundation. As I recall, rjni was something that came out of the
2003 European Ruby conference and at the time there was a lot of
excitement about it because it is a great way to introduce Ruby into
Java shops - don’t let it die! If you set rjni free it will have
more of a chance to develop and mature than if it sits in your local
repository. Perhaps the best thing you can do now to help rjni
development is to write up some minimal documentation on what you have
at this point (maybe use rdoc to speed things up).

Phil

···

On Tue, Jan 27, 2004 at 10:29:56PM +0900, Robert Klemme wrote:

Mauricio Fernández wrote:

···

On Tue, Jan 27, 2004 at 10:29:56PM +0900, Robert Klemme wrote:

If we mix ruby & java I was thinking about using rjni or rjava.

I’m sorry to have to tell you that rjni is at best alpha :frowning:
I’ve got a nearly feature-complete version in my local repository but I
haven’t released it, since I don’t see myself spending much time on
it in the near future, and I don’t want to mislead anybody into
thinking so.

If you release rjni you will be granted 3 wishes :wink:

Release the code!! If you don’t have time others may. I may. =)

Zach

···

-----Original Message-----
From: Mauricio Fernandez [mailto:batsman.geo@yahoo.com]
Sent: Tuesday, January 27, 2004 8:52 AM
To: ruby-talk ML
Subject: Re: choosing ruby?

On Tue, Jan 27, 2004 at 10:29:56PM +0900, Robert Klemme wrote:

If we mix ruby & java I was thinking about using rjni or rjava.

I’m sorry to have to tell you that rjni is at best alpha :frowning:
I’ve got a nearly feature-complete version in my local repository but I
haven’t released it, since I don’t see myself spending much time on
it in the near future, and I don’t want to mislead anybody into
thinking so.


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

The most important design issue… is the fact that Linux is supposed to
be fun…
– Linus Torvalds at the First Dutch International Symposium on Linux

can I say that I agree?
I wonder if the maintainer of rjava would like to adopt it, cause he
already planned a jni bridge.

···

il 27 Jan 2004 10:07:13 -0800, intc_ctor@yahoo.com (Phil Tomson) ha scritto::

Please do release it.

There are lots of ways to build Java webapps, so perhaps we shouldn’t
continue this thread for too long… :slight_smile:

With Java the Servlet Container (aka Tomcat) takes care of marshalling and
unmarshalling data.

I was referring of the marshalling / unmarshalling into a Java Bean from
request parameters (and translation into proper primitive types) not the
http decoding part - should have been more clear.

He’ll also have to deal with page navigation and control flow, one thing
which Maverick gives you at low cost. Using ‘logical’ page names in the
application instead of hardcoded forwards is nice to have for small
apps, a must for large ones. Struts offers the same thing.

Validation is another story, but that’s usually easy in a Servlet given
the size of this webapp.

Yup, he might not need anything… if he does, consider
http://formproc.sourceforge.net/
http://jakarta.apache.org/commons/validator/

I don’t know maverick, but I’d like to comment on velocity. For the last
webapp we did we evaluated velocity, too, but came to the conclusion that
JSP is the better choice:

one more negative for velocity

  1. more jsp books to help you learn

For the plus’ of Velocity:

  1. IMO, shoter learning curve (don’t need book :slight_smile:
  2. smaller, cleaner syntax - expressions already looks like the
    JSP 2.0 expression syntax
  3. promotes good MVC architecture - whereas JSP can be used
    in very wrong ways
  4. negligible performance hit
  5. does one thing very well

[more opinion on the velocity web site]

I have disliked JSP’s since the beginning, and using them extensively
has only confirmed it. JSP 2.0 is however a vast improvement.

Mark.Volkmann@AGEDWARDS.com

I’ll second that recommendation for using Maverick.
I’ve created a PowerPoint presentation on using Maverick that I’d gladly
share if you’re interested.

I wouldn’t mind seeing that… I’m thinking of presenting something
myself …

I have to confess it’s not a matter of time – it’s just that I’m facing
the need to rewrite it all in C (for performance) and frankly that’s no
fun :expressionless:

I’ll clean it a bit, add some docs and release it as another technology
preview.

···

On Wed, Jan 28, 2004 at 03:09:56AM +0900, Phil Tomson wrote:

Please do release it. Perhaps you won’t be having time to work on
it in the future, but others may want to work on it. In fact if you
don’t think you’ll be having time to work on it that’s all the more


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Because I don’t need to worry about finances I can ignore Microsoft
and take over the (computing) world from the grassroots.
– Linus Torvalds

Mauricio Fernández wrote:

If we mix ruby & java I was thinking about using rjni or rjava.

I’m sorry to have to tell you that rjni is at best alpha :frowning:
I’ve got a nearly feature-complete version in my local repository but I
haven’t released it, since I don’t see myself spending much time on

Due to popular demand I have cleaned my latest code, added some API
documentation and released it under

http://www.thekode.net/ruby/rjni

For the record:

rjni exposes the Java Native Interface to Ruby. This allows the programmer
to instantiate Java objects, manipulate them, etc… from Ruby.

Note that rjni is not meant to embed Ruby in Java, although it can be
used to ease integration in that case.

WARNING: THIS IS A TECHNOLOGY PREVIEW. THE SOFTWARE IS NOT EVEN ALPHA
QUALITY AT THE MOMENT AND IS NOT MEANT TO BE USED YET. IT IS ONLY
PROVIDED TO PRESENT THE TECHNIQUES EMPLOYED AND (HOPEFULLY) TO
ACCELERATE THE DEVELOPMENT.

it in the near future, and I don’t want to mislead anybody into
thinking so.

If you release rjni you will be granted 3 wishes :wink:

Whom should I contact? :slight_smile:

···

On Wed, Jan 28, 2004 at 01:21:37PM +0900, Joel VanderWerf wrote:

On Tue, Jan 27, 2004 at 10:29:56PM +0900, Robert Klemme wrote:


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

The state of some commercial Un*x is more unsecure than any Linux box
without a root password…
– Bernd Eckenfels

Mauricio Fernández batsman.geo@yahoo.com wrote in message news:20040127203721.GA1823@student.ei.uni-stuttgart.de

Please do release it. Perhaps you won’t be having time to work on
it in the future, but others may want to work on it. In fact if you
don’t think you’ll be having time to work on it that’s all the more

I have to confess it’s not a matter of time – it’s just that I’m facing
the need to rewrite it all in C (for performance) and frankly that’s no
fun :expressionless:

Would it be premature optimization? In other words, do you have all
the functionality you need with Ruby code yet? If you don’t rewrite
in C is the performance in Ruby acceptable?

I think in most cases performance is probably acceptable. In cases
like this, I (as a user) like having the option of using the pure
Ruby implementation if possible because I’m not always in a position
to compile the extension. So I would recommend that when you do the
rewrite in C that you not actually replace the Ruby code, but offer it
as an option.

for example:

begin
require ‘rjni.so’ #try for the C implementation first
rescue LoadError
require ‘rjni.rb’ #if it’s not available use the ruby implementation
end

Or, perhaps for the time being while you’re implementing parts of it
in C you could do something like:

require ‘rjni.rb’
begin
require ‘rjni_speedup.so’
rescue LoadError
puts “no speed up available for now; going with pure Ruby
implementation”
end

Where rjni_speedup.so contains the C implementations for various
methods that could benefit from a C implementation. That way you
don’t have to think that you need to rewrite everything over in C
before you can release, you can release small chunks of C
implementation as you have time.

I’ll clean it a bit, add some docs and release it as another technology
preview.

cool.

Phil

···

On Wed, Jan 28, 2004 at 03:09:56AM +0900, Phil Tomson wrote:

Very cool. Do you suppose someone could move it over to the rjni
project on RubyForge?

http://rubyforge.org/projects/rjni/

That might make it a bit easier for other folks to browse the code, make
comments, and so forth…

Yours,

Tom

···

On Thu, 2004-01-29 at 11:34, Mauricio Fernández wrote:

WARNING: THIS IS A TECHNOLOGY PREVIEW. THE SOFTWARE IS NOT EVEN ALPHA
QUALITY AT THE MOMENT AND IS NOT MEANT TO BE USED YET. IT IS ONLY
PROVIDED TO PRESENT THE TECHNIQUES EMPLOYED AND (HOPEFULLY) TO
ACCELERATE THE DEVELOPMENT.

I have to confess it’s not a matter of time – it’s just that I’m facing
the need to rewrite it all in C (for performance) and frankly that’s no
fun :expressionless:

Would it be premature optimization? In other words, do you have all
the functionality you need with Ruby code yet? If you don’t rewrite
in C is the performance in Ruby acceptable?

The main slowdown comes from overloading. Simple methods can be
dispatched at a rate of 30000/s or so on a 1700XP+ K7. However, once
you get several methods with different signatures (but same name) this
figure degrades quickly.

I think in most cases performance is probably acceptable. In cases
like this, I (as a user) like having the option of using the pure
Ruby implementation if possible because I’m not always in a position
to compile the extension. So I would recommend that when you do the

An extension is always needed (I don’t think I could wrap all of JNI
only with Ruby/DL). What I meant is that in the current code base only
a basic JNI wrapping is implemented in C, and everything else (method
dispatching, parameter conversion, simulation of singletons,
exceptions…) is written in Ruby using the extension.

[…]

Where rjni_speedup.so contains the C implementations for various
methods that could benefit from a C implementation. That way you
don’t have to think that you need to rewrite everything over in C
before you can release, you can release small chunks of C
implementation as you have time.

<grain_of_salt>
That’s a possibility… surely way more gratifying than having to write
some 10000-15000 lines of tedious, boring C code, for a project I have
personally nothing to gain from besides ‘experience’ (I do not use Java :P).
Still, I took a look at my code today and felt like playing with
it a bit more (I’m finding it exciting again :), but I just don’t want to
fool anybody into thinking I’ll deliver a business-grade product: I can
only withstand a limited amount of boring/tedious coding, there are
so many interesting things competing with that (which do not require
leaving Ruby, btw) :wink:
</grain_of_salt>

···

On Thu, Jan 29, 2004 at 02:59:54AM +0900, Phil Tomson wrote:


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Turn right here. No! NO! The OTHER right!

Sure, I was the one who registered it :wink:
Expect to find it there in a while (I’m copying it right now)…

···

On Fri, Jan 30, 2004 at 01:44:34AM +0900, Tom Copeland wrote:

On Thu, 2004-01-29 at 11:34, Mauricio Fernández wrote:

WARNING: THIS IS A TECHNOLOGY PREVIEW. THE SOFTWARE IS NOT EVEN ALPHA
QUALITY AT THE MOMENT AND IS NOT MEANT TO BE USED YET. IT IS ONLY
PROVIDED TO PRESENT THE TECHNIQUES EMPLOYED AND (HOPEFULLY) TO
ACCELERATE THE DEVELOPMENT.

Very cool. Do you suppose someone could move it over to the rjni
project on RubyForge?

http://rubyforge.org/projects/rjni/


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

‘Ooohh… “FreeBSD is faster over loopback, when compared to Linux
over the wire”. Film at 11.’
– Linus Torvalds

Mauricio Fernández batsman.geo@yahoo.com wrote in message news:20040128183828.GA24920@student.ei.uni-stuttgart.de

···

On Thu, Jan 29, 2004 at 02:59:54AM +0900, Phil Tomson wrote:

I have to confess it’s not a matter of time – it’s just that I’m facing
the need to rewrite it all in C (for performance) and frankly that’s no
fun :expressionless:

Would it be premature optimization? In other words, do you have all
the functionality you need with Ruby code yet? If you don’t rewrite
in C is the performance in Ruby acceptable?

The main slowdown comes from overloading. Simple methods can be
dispatched at a rate of 30000/s or so on a 1700XP+ K7. However, once
you get several methods with different signatures (but same name) this
figure degrades quickly.

I think in most cases performance is probably acceptable. In cases
like this, I (as a user) like having the option of using the pure
Ruby implementation if possible because I’m not always in a position
to compile the extension. So I would recommend that when you do the

An extension is always needed (I don’t think I could wrap all of JNI
only with Ruby/DL). What I meant is that in the current code base only
a basic JNI wrapping is implemented in C, and everything else (method
dispatching, parameter conversion, simulation of singletons,
exceptions…) is written in Ruby using the extension.

[…]

Where rjni_speedup.so contains the C implementations for various
methods that could benefit from a C implementation. That way you
don’t have to think that you need to rewrite everything over in C
before you can release, you can release small chunks of C
implementation as you have time.

<grain_of_salt>
That’s a possibility… surely way more gratifying than having to write
some 10000-15000 lines of tedious, boring C code,

Can a tool like Swig help to automate the process? I wouldn’t want to
type in that much C code either. Check out http://www.swig.org and
see if it will help you avoid all that coding.

Phil

Done. From now on, the latest version of rjni will also be available at
http://rjni.rubyforge.org

···

On Fri, Jan 30, 2004 at 02:15:34AM +0900, Mauricio Fernández wrote:

Very cool. Do you suppose someone could move it over to the rjni
project on RubyForge?

http://rubyforge.org/projects/rjni/

Sure, I was the one who registered it :wink:
Expect to find it there in a while (I’m copying it right now)…


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

‘Ooohh… “FreeBSD is faster over loopback, when compared to Linux
over the wire”. Film at 11.’
– Linus Torvalds