Slashdot Mirror


JRuby Great Addition To Java Development

An anonymous reader writes "JRuby combines the object-oriented strength of Smalltalk, the expressiveness of Perl, and the flexibility of the Java class libraries into a single, efficient rapid development framework for the Java platform. This article introduces JRuby, a sophisticated addition to your Java development toolbox."

6 of 51 comments (clear)

  1. other languages by Intrigued · · Score: 4, Informative
    To my understanding, this is one script interpreter that is being developed for Java. It offers ease of use for people accostumbed to working with Ruby.

    For a larger view of the language development being done similar to this, take a look at List of Java virtual machine languages.

    I should think that most people will find at least something that appeals to them.

  2. Re:So what exactly is the difference... by bonniot · · Score: 5, Informative
    Ruby and Groovy are different languages. They happen to be both scripting languages, and to have an implementation that runs on the jre (Java Runtime Environment), that's all.

    The JRuby article is part of the alt.lang.jre series, with announced articles about "Rhino, Nice, and NetRexx, and many other exciting alternate languages for the JRE". It looks like the articles are coming in this order, one around the beginning of each month.

  3. JRuby versus Java [code comparison - short] by tod_miller · · Score: 4, Funny
    JRuby
    require 'java'
    module Swing
    include_package 'java.awt'
    include_package 'javax.swing'
    end
    module AwtEvent
    include_package 'java.awt.event'
    end

    $calculator = Swing::JFrame.new
    class << $calculator

    def init
    end

    end

    $calculator.init
    $calculator.setSiz e(400, 400)
    $calculator.setVisible(true)
    versus Java
    import javax.swing.JFrame;
    public class Calculator extends JFrame {
    public Calculator(){
    super("Slashdot Rul3z");
    setSize(400, 400);
    setVisible(true);
    }
    public static void main(String[] args) {new Calculator();}
    }
    and we have a winner
    --
    #hostfile 0.0.0.0 primidi.com 0.0.0.0 www.primidi.com 0.0.0.0 radio.weblogs.com
    1. Re:JRuby versus Java [code comparison - short] by bzhou · · Score: 4, Funny
      vs. Jython
      from java import awt
      from pawt import swing

      labels = ["0", "1", "2", "+",
      "3", "4", "5", "-",
      "6", "7", "8", "*",
      "9", ".", "=", "/" ]

      keys = swing.JPanel(awt.GridLayout(4, 4))
      display = swing.JTextField()

      def push(event):
      display.replaceSelection(event.actionCommand)

      d ef enter(event): # <= def, slashdot formatting bug?
      display.text = str(eval(display.text))
      display.selectAll()

      for label in labels:
      key = swing.JButton(label)
      if "=" == label:
      key.actionPerformed = enter
      else:
      key.actionPerformed = push
      keys.add(key)

      panel = swing.JPanel(awt.BorderLayout())
      panel.add("North ", display)
      panel.add("Center", keys)
      swing.test(panel)
  4. About that name by HughsOnFirst · · Score: 4, Funny

    So when I tell somone that this is the right tool for the job , how am I supposed to pronounce it?
    ja-ru-bee? ( gummie candy treat perhaps? )
    har-you-bee ?
    or jay-ru-bee as though it were named after Lee Harvey Oswald's killer Jack Ruby ( J. Ruby ) ?

  5. Hrmph. by Estanislao+Mart�nez · · Score: 4, Informative
    Last I looked (which can't have been over a month ago), JRuby was far from being ready for prime time. I'm a Ruby guy myself, yet I really wouldn't touch JRuby just yet, unless my purpose was to develop it myself.

    Groovy is, IMO, a near-clone of Ruby designed from the ground up to integrate with Java, and would probably be a better choice than JRuby. I think the Groovy documentation isn't quite there yet, tugh.