SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Ruby & Java vs JRuby

  1. #1
    SitePoint Member
    Join Date
    Oct 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ruby & Java vs JRuby

    My team has been doing Java for a long time. We are switching to Ruby. We are finding that Ruby has limitations and that we have to do certain things in Java. I'm trying to find a way to call Java code from Ruby. I'm searching Google and such, and I always end up on a page describing how to call Java code from JRuby. That's not what I want.

    Then I start to wonder why we're NOT using JRuby?! Instinctively, I'm thinking Java and Ruby is what we're doing. JRuby is the best of both worlds. What am I missing?

    I've asked around a little bit and I've heard a few negative things about JRuby, such as memory issues or diminishing oracle/community support, or whatever. Is JRuby a dud? Or is it viable for real-world, large-scale, mission critical apps, the way Ruby/Rails supposedly is? Is there a reason that we should be coding in Ruby AND Java instead of just going with JRuby? Can we not use Rails if we do JRuby? I mean, why wouldn't you want access to all the comprehensive features in Java, combined with the ease/fun of Ruby?!

    Thoughts?

  2. #2
    padawan silver trophy
    SitePoint Award Recipient markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,013
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by brackishwater View Post
    My team has been doing Java for a long time. We are switching to Ruby. We are finding that Ruby has limitations and that we have to do certain things in Java. I'm trying to find a way to call Java code from Ruby. I'm searching Google and such, and I always end up on a page describing how to call Java code from JRuby. That's not what I want.

    Then I start to wonder why we're NOT using JRuby?! Instinctively, I'm thinking Java and Ruby is what we're doing. JRuby is the best of both worlds. What am I missing?

    I've asked around a little bit and I've heard a few negative things about JRuby, such as memory issues or diminishing oracle/community support, or whatever. Is JRuby a dud? Or is it viable for real-world, large-scale, mission critical apps, the way Ruby/Rails supposedly is? Is there a reason that we should be coding in Ruby AND Java instead of just going with JRuby? Can we not use Rails if we do JRuby? I mean, why wouldn't you want access to all the comprehensive features in Java, combined with the ease/fun of Ruby?!

    Thoughts?
    Check out this railscast if you're competely new to JRuby.
    http://railscasts.com/episodes/376-jruby-basics

    I haven't used JRuby myself but I know people who have used it in production and it does seem to work well. A couple of things
    I've heard because of the way the JVM works the startup time is quite slow as it optimizes things. And, you might run into compatibility issues with certain gems.

    Can we not use Rails if we do JRuby?
    You can use Rails in it's entirety, you just also have access to all of the Java libraries should you need them from Ruby.

    I'd seriously question why you need to access Java from Ruby though. Obviously, including Java in your stack is adding complexity you might be better off avoiding. You say Ruby has limitations, and that may be true but what in particular are you referring to?

    Working with services / api's might be a better option, you'll need to do some research.

  3. #3
    SitePoint Member
    Join Date
    Oct 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am forced to use Java because we have legacy systems that we must communicate with using CORBA. So far, all attempts to do CORBA calls directly from Ruby have failed. Support is weak, options are limited, everything I've tried hasn't worked, etc. Given that I have already implenented this in Java and it works great, I figure I'd just reuse that module. I would of course rather do this from within Ruby. It's ridiculous to have to run a JVM on top of my Ruby runtime JUST to do a CORBA call here and there. So please let me know if you think I should keep trying to make these calls from Ruby. I just wasn't feeling the love from Ruby and wasn't getting anywhere.

  4. #4
    SitePoint Member
    Join Date
    Apr 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We use JRuby in conjunction with java and it work great on a JBoss cluster in production.
    Legacyworld we connect with soap (no toolbox, just posts).
    Inernally we communicate rest and with java assync via hornetqueue. Functions like jndi we just call java from jruby .....
    Result : great !

    regards

    erhard

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •