Slashdot Mirror


Groovy JSR: A New Era for Java?

fastdecade writes "Groovy, the open-source scripting language, has been submitted for a Java Specification Request (JSR). And not without strong support from venerable J2EE practitioner/author, Richard Monson-Haefel, who labels this "the beginning of a new era in the Java platform". Groovy can use Java objects easily and compiles to JVM byte code, but it is nonetheless a scripting language at heart and a great companion for the more heavyweight Java programming language. Most JSRs concern new APIs, and this is the first JSR for an alternative language. Imagine a common platform of standardised languages talking to each other ... this looms as a big threat to .Net and a rejuvenation of the Java platform."

11 of 100 comments (clear)

  1. wasn't it that... by whathappenedtomonday · · Score: 2, Insightful

    java can only succeed if the runtime is part of consumer OSs? right now, I think it is not... . probably got this one wrong, dunno...

    --
    I hope I didn't brain my damage.
  2. Isn't this more a threat to Perl than .Net? by ObviousGuy · · Score: 5, Insightful

    Having a glue language to tie together Java objects is definitely cool, as is having the scripting language compile down to bytecode for easy deployment.

    I guess in some obscene way, one could infer that Java is somehow a threat to .Net because its set of tools has grown a little, but Groovy itself seems to be more a threat to Perl and Python and other scripting languages rather than anything Microsoft is doing (except for WSH, but is anyone really using that?) Having a scripting language that can reach directly into Java bytecode without having to invoke a separate VM is a great improvement over the current methods of running external Java programs.

    Frankly, to me, it doesn't matter which 'platform' succeeds. Both frameworks exist on many platforms, so whichever wins, we all benefit.

    --
    I have been pwned because my /. password was too easy to guess.
  3. Let Me Get This Straight by Markus+Registrada · · Score: 4, Insightful
    This is like Python, except it's less portable (because JVMs are less widely ported than Python), and has a bigger memory footprint (because it uses JVM garbage collection instead of Python reference-counting), and it uses libraries with different actual semantics and different bugs on different platforms (because they're the Java libraries).

    It sounds to me like anywhere you think you want this, you would be better off with actual Python.

    1. Re:Let Me Get This Straight by malachid69 · · Score: 4, Insightful
      it's less portable (because JVMs are less widely ported than Python)

      What platforms is Java NOT ported to?

      I know it is available for Windows, Linux, FreeBSD, AIX, HP-UX, Solaris, AS/400, Handhelds (Palm, Handspring, SaveJe, etc), and direct hardware (PTCU and TINI)... What's missing?

      --
      http://www.google.com/profiles/malachid
    2. Re:Let Me Get This Straight by Pengo · · Score: 4, Insightful

      "It sounds to me like anywhere you think you want this, you would be better off with actual Python."

      Unless you want access to any of the miriad of Java libraries that are available, such as JDBC drivers, XML parsers, SOAP tools and 3rd party components you may want to use unless you prefer to use something like Jython.

      I have to work with other bits of code and systems all the time, and thats the main headache with using Python that I run into.

      Python might be king of quick hacks, but for a large-scale project where bits of scripting code might be appropriate, this sounds like an excelent option where you would NOT be better off with python.

    3. Re:Let Me Get This Straight by hak1du · · Score: 3, Insightful

      Except [Groovy] actually elegant, based on Smalltalk, not whatever the heck Python is inspired by.

      I don't see anything "elegant" about yet another scripting language built on top of a runtime designed for a simple statically typed language (Java).

      And Python reference counting stinks,

      True. It also makes the C-Python interpreter slower than a garbage collected version. It is somewhat disconcerting that this misfeature of C-Python still exists after so many years. In fact, the C-Python implementation has a number of other weak points. But it works well enough, and it sure is a lot more practical than running a JVM just to execute Groovy.

      I use Python, but I sure don't think there's anything "great" about it,

      Neither do I--Python is just one of many scripting languages. But between Python and the available alternatives, I think Python still is the best of the bunch. A JVM-only language like Groovy isn't even worth talking about.

  4. rejuvenation? by sfjoe · · Score: 4, Insightful

    ...and a rejuvenation of the Java platform.

    I think people who make statements like this aren't really aware of how widespread the usage of Java is in enterprise and multi-tiered systems.

    Java is not just applets.

    --
    It's simple: I demand prosecution for torture.
  5. JCP naming thunk? by Tailhook · · Score: 3, Insightful

    Hopefully the name will get changed prior to getting this into the JSE platform. Does it bother anyone else to imagine having to talk about something called Groovy in a professional environment? The Groovy site is chock full of cuteness about making this or that more or less "groovy". I don't mind it personally but it's not helpful when you expect non-technical types to have faith in stuff.

    Anyhow, the JSE platform could use an implicit scripting language. I can see the technical merit in this. A Groovy based shell (with exceptions, an abstract file system, all the JDBC goodness integrated, etc.) that works right everywhere would be a nice bit of progress.

    --
    Maw! Fire up the karma burner!
  6. Re:Blocks! by Anonymous Coward · · Score: 1, Insightful

    The cool thing about blocks, that hardly anybody seems to mention, is that you can factor out "transactional" code. For instance, code like this:

    t = open_thing()
    try:
    frob(t)
    fozzle(t)
    glorp(t)
    finally:
    close_thing(t)

    In ruby you can factor out the try/finally and just do:

    with_thing { |t|
    frozzle(t)... etc
    }

    and you don't have to clutter the code with the same construct, over and over. This is why ruby is so popular with the XP crowd, you can factor out common stuff into ONE PLACE which you can't do with java or python.

    More examples:

    File.open('/foo/bar') { |f| ..
    }

    YOu know the file is closed at the end of the block.

    busy_cursor { .. do something time-consuming..
    }

    never worry about forgetting to put the cursor back at the end of the operation, or if the operation throws an exception.

    run_time = stopwatch { ...
    }

    stopwatch() is a function that simply times the code in the block.

    Wonderful feature that improves readability and allows you to factor out common setup/teardown code.

  7. Re:Blocks! by Unordained · · Score: 3, Insightful

    would you mind explaining in what way

    hash.each_pair do |key,value|

    is not "special" syntax, but

    foreach ($array_name as $key_name => $value_name)

    is?

  8. what's the point? by hak1du · · Score: 3, Insightful

    Groovy seems to offer nothing that you don't already get in Python, and Python has implementations available based on C (C Python), Java/JVM (Jython), and C#/CLR (IronPython).

    The only thing Groovy does offer is that it is Java/JVM-specific at this point--there are no implementations based on anything other than the Java/JVM runtime. That may be a good thing for Sun--tying people even more to Sun's platform--but it sure isn't good for anybody else.