|
Sponsored Links
Resources
Enterprise Java Research Library
Get Java white papers, product information, case studies and webcasts
|
News
News
News
|
Messages: 26
Messages: 26
Messages: 26
Printer friendly
Printer friendly
Printer friendly
Post reply
Post reply
Post reply
XML
XML
XML
|
 |
JCP Approves Groovy Language JSR: Sun endorses language
The JCP has approved JSR 241, the Groovy Language. The entire executive committee voted yes, with Sun adding a very positive comment: "Sun is happy to see Groovy proposed as a JSR. Having additional interesting languages for the Java platform seems like a Good Thing!"
This JSR sets a huge precedent. Sun has really shown that they care a lot more about Java the platform, as apposed to just Java the language.
This is great news for the community. There was also a rumor that James Gosling himself said: "Groovy is groovy" and that he pushed for the JSR to go through.
View the results of the JSR 241 Ballot
View the JSR 241 home page
|
|
Message #115770
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JCP Approves Groovy Language JSR: Sun endorses language
Good work! Interesting timing with recent posting by Mike Spille about using the Groovy language. With the passing of the JSR, does this effectively mean Groovy is the official scripting language for Java?
Michael
|
|
Message #115772
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JCP Approves Groovy Language JSR: Sun endorses language
Ghorrr!
You're looking for controversy Michael!
Graham (on behalf of Sun's) comment is kinda interesting isn't it. Well if Groovy can be made into a ship-shape well engineered _and_ agile language then all the better. Also MS have loads of langauges for their platform so I imagine it's a flower in the cap for Sun if they can add one 'officially' to their platform.
I think Sun's 'approval' is a good thing, any new 'agile' (for want of a better word) langauge needs some serious patronage if it's going to get used in most of our working lives.
Regards Neil
|
|
Message #115773
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JCP Approves Groovy Language JSR: Sun endorses language
Quite a sweeping approval... Congratulations to James and his team!
-- Cedric
|
|
Message #115779
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
if the shoe fits...
You're looking for controversy Michael! I wasnt intentionally looking for controversy and if I was I dont think that is necessarily a bad thing. But I have noticed the absence of the equivalent of say VB in Java. So I was wondering (in the perception of other Java programmers) if Groovy fits that sort of shoe. I hope it is a flower in the cap and that other scripting languages come out. I forgot about PHP but then again, I have not used it (read about scalability issues). Speaking of, how does Groovy compare to PHP? Are they apples and oranges?
Best regards, Michael
|
|
Message #115780
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
if the shoe fits...
Now we are close to admit that we have several competing OS: Linux, Java and Win(.NET is just next version of MS OS)
|
|
Message #115788
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
if the shoe fits...
> Speaking of, how does Groovy compare to PHP? > Are they apples and oranges?
PHP has quite impressive function library written in C. It's also very straight forward to use. Some say that you can program with PHP the way you think. I have got this feeling very often when I have worked with PHP. For example if I want 32-byte hex-decimal md5 output from something, I just call md5("something");, and these cases pop-up all the time. When doing something similar with Java I have to read api documentations and find my way out of overly complicated and abstracted Java implementations. Usually I end up with some utility class that has static method that performs the thing I want. It's quite sad that I almost always end up writing those same utilities over and over again. With PHP, this is not the case.
Right now Groovy, in my opinion, is nothing more than a new syntax. It has some shortcuts that make programming simple Java programs easier (than doing them in Java), and it has it's uses in some projects (embedded scripting in java environment, quick prototyping of Java apps, etc.). But I think that Groovy needs some PHP like utilities (maybe done in OO ways) to become something more than a syntax. Every scripting language has these (I mean libraries specifically designed for the scripting language itself). Groovy takes another approach by leveraging J2SE and J2EE etc. standard Java libraries (correct if I'm wrong). What I would like to see is that Groovy implements it's own libraries that wrap/reimplement Java libraries to make the most common things as simple as possible.
Just thoughts.
|
|
Message #115796
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Re: JCP Approves Groovy
This is long overdue. Unfortunately Sun/JCP isn't driven by community demands, but by pressure from Microsoft.
|
|
Message #115799
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
if the shoe fits...
What I would like to see is that Groovy implements it's own libraries that wrap/reimplement Java libraries to make the most common things as simple as possible.Just thoughts. Groovy actually does just this. For example it extends anything that implements java.util.Collection with an each method so you can do things like: collection = [1, 2, 3] collection.each { print it }
|
|
Message #115809
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
if the shoe fits...
Yep. For comprehensive details, see:
http://groovy.codehaus.org/groovy-jdk.html
Most interesting to me are the ones in *Writer/*Reader, *Stream, Object, String, and of course the various Collections. You gotta love things like Reader.eachLine(), Reader.readLines(), and BufferedReader.getText(). Being able to say:
InputStream is = new FileInputStream (...some file...); List file = is.readLines();
and getting a List of the lines in the file is extremely convenient for scripty purposes. And being final able to say something like this is just excellent:
InputStream is = new FileInputStream (...some file...); is.eachLine ( { // Closure with 'it' parameter containing each source line // in successive calls. });
-Mike
|
|
Message #115818
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
ver y nice
It's soo cool to see that SUN has received groovy as j2EE languaje. I was really thinking that java would be the only one for j2ee, but sun has surprise me. It's great!
|
|
Message #115829
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JCP Approves Groovy Language JSR: Sun endorses language
Congratulations groovy!
Somehow I think this will be the shortest bile to follow up bile in the history of Hani. But you know you've made it when Hani's ulcers start acting up.
|
|
Message #115832
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JCP Approves Groovy Language JSR: Sun endorses language
does this effectively mean Groovy is the official scripting language for Java? Michael I dont think its anyone's intention for it to be the official scripting language. Just an official scripting language...
-Nick
|
|
Message #115855
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
What advantage does groovy have over other scripting languages?
Just curious as to what advantage does groovy have over other scripting languages that run on the JVM, such as JPython or JavaScript?
I am interested because I have been using JavaScript with XWork to script my business logic. I like JS because I then have one scripting language for both the client and server, and as I also do some Flash MX work, which uses ActionScript (ECMA script).
|
|
Message #115867
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
What advantage does groovy have over other scripting languages?
Just curious as to what advantage does groovy have over other scripting languages that run on the JVM, such as JPython or JavaScript? I guess the different is JPython/JRuby/etc is running on a scripting engine that itself running ontop of the JVM. So virtually the script you wrote will be interpreted twice ;-)
While Groovy is compiled into Java bytecode, which is the same as compiled Java source to the JVM.
|
|
Message #115878
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
What advantage does groovy have over other scripting languages?
I guess the different is JPython/JRuby/etc is running on a scripting engine that itself running ontop of the JVM. So virtually the script you wrote will be interpreted twice ;-)While Groovy is compiled into Java bytecode, which is the same as compiled Java source to the JVM. This is implementation details, some "old" scripting languages are compiled into Java bytecode too, see dynamicjava or javascript, it is not the major feature and it not performant in some cases.
|
|
Message #115896
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Groovy In A Nutshell - 40+ Talk Slides In All-In-One HTML Page
Hello,
> Just curious as to what advantage does groovy have over other scripting > languages that run on the JVM, such as JPython or JavaScript?
Allow me to highlight my Groovy talk slides (40+) online in an all-in-HTML-page version titled "Groooooovy Babe: Jazzing Up Plain Old Java".
To quote from the slide titled "Why Groovy? What's wrong with Python (Jython), Ruby (JRuby) or Smalltalk (Bistro)?"
Why yet another scripting language?
* Groovy builds on (reuses) the Java standard class library; Python, Ruby or Smalltalk include their own batteries (that is, standard libraries) * Groovy uses a Java-like syntax; easy to switch from Java to Groovy or from Groovy to Java * Groovy compiles straight to standard Java bytecode; you can use Groovy (groovyc) as an alternative compiler to javac - Gerald
|
|
Message #115897
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JCP Approves Groovy Language JSR: Sun endorses language
Good Luck! ...but this is the beginning of the end!...Playing with the same model of Microsoft (Groovy==VB&family) is not the answer!... However show must go on!
|
|
Message #115902
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Groovy In A Nutshell - 40+ Talk Slides In All-In-One HTML Page
> Groovy builds on (reuses) the Java standard > class library; Python, Ruby or Smalltalk > include their own batteries (that is, standard > libraries)
Likewise Groovy has to reimplement/wrap several (or all) J2SE /J2EE etc. libraries to make them even remotely usable in scripting environment (eg. Collections, Readers (allready done) and this list should continue to contain most of J2SE classes (not yet done) -> meaning Groovy has it's own standard library). If they are not going to do that, then Groovy gives a little over plain Java.
> Groovy uses a Java-like syntax; easy to > switch from Java to Groovy or from Groovy > to Java
So does C++, C#, JavaScript and many others.
> Groovy compiles straight to standard Java > bytecode; you can use Groovy (groovyc) as > an alternative compiler to javac
That's what all other 30+ JVM scripting languages have done for ages.
|
|
Message #115908
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Groovy Offers The Best From Ruby, Python and Smalltalk
> That's what all other 30+ JVM scripting languages have done for ages.
First, I'm not a Groovy fanatic and you're free to choose whatever scripting language you think is best. I've even assembled a Scripting Languages for Java page over at the Viva! site.
Anyway, even though most scripting languages compile down to bytecode Groovy goes further. If I may quote from the "Compiling Groovy Scripts Using groovyc" slide:
Note, that every Groovy class becomes a "normal" Java class that you can use inside your Java code. The only difference between a Groovy generated Java class and a plain old Java class is that a Groovy generated Java class supports the groovy.lang.GroovyObject interface.
- Gerald
|
|
Message #115921
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Critizizing
> you're free to choose whatever scripting language
Of course (I'm not an idiot). I just wanted to critizize Groovy (I did try to do it in a constructive manner).
> Compiling Groovy Scripts Using groovyc
I don't see how this differs from eg. (except that Groovy implements GroovyObject): http://jython.sourceforge.net/cgi-bin/faqw.py?req=show&file=faq06.001.htp
I have to admit that Groovy has more elegant Java bindings than other similar projects, but Groovy without it's own libraries (J2SE doesn't fit, in my opinion, in scripting environment) is just another syntax.
|
|
Message #115970
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Critizizing
The classes genererated by groovy and beanshell 2.0 are real java objects - one can use reflection on them to get the methods / fields. This is very usefull for intergrating with other systems, for example with ant, it is easy to write ant tasks in groovy or beanshell.
|
|
Message #117373
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Why a *compiled* scripting language?
I attended a presentation on Groovy at a Java conference recently, and the big surprize for me was that Groovy was a compiler and not an interpreter. I've used Perl, Java, and played with BeanShell, and when I heard of Groovy as a standard "scripting" language I just assumed it would be an interpreter, since for me the joy of using a scripting language, aside from loose typing, is switching from the edit/compile/run mode into the more comfy and streamlined edit/run.
Seriously, when I think of working with JavaScript and being able to make a change, save it in the editor and just refresh my browser to test, versus (for example) working on Struts Action code and having to re-compile it and redeploy it to the app server, I think the interpreted approach wins hands down for programmer productivity. At least it seems so to me, and so when I realized Groovy was still a compiled language might first thought was this was a big mistake and if Sun wants something that truly *complements* Java they would have better chosen something more like BeanShell (i.e. an interpreted Java with optional loose typing features).
Am I making too much of this? Are they planning to do things analogous to the way JSP's are auto-magically compiled to make it feel more like an interpreted scripting language? Or am I wrong to think of compilation as a significant headache?
I don't think I'm wrong - but I'm curious what others think. Obviously there's smart people who approved this JSR. I just think practically and politically something like BeanShell would have been a better "standard" Java scripting language.
|
|
Message #117380
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Why a *compiled* scripting language?
Darren, yes it's compiled, but if you want to use it in a scripty way you often can't tell that it is.
Groovy ships with a wrapper program (called 'groovy' :-) that lets you execute scripts directly. Well, you're not really doing it directly but it acts as if it does. It's not exactly like, say, perl, but it's close enough so that you can't tell the difference most of the time.
So it's easy to just say:
groovy myscript.groovy
or to use Unix #! notation:
#!groovy // Groovy code
-Mike
|
|
Message #117454
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Why a *compiled* scripting language?
You're right that is pretty slick - does make it look just like other scripting languages when running from the command line. There's two other modes I'm curious about though:
a. Embedded usage/"Eval": e.g. I'd like to embed Groovy snippets to act as Struts actions, and iteratively refine/debug them (i.e. edit/test/edit/test quick quick quick - i.e. no headaches/slowdowns from app server redeployment). b. Interactive usage: e.g. The "shell" in "BeanShell" is that it literally has an interactive shell, where you can interactively develop and debug programs from this BeanShell "command line". Great for learning and debugging.
Do you know if Groovy can work in these modes?
|
|
Message #117473
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Why a *compiled* scripting language?
On a), yeah you can embed Groovy, but it's a little wordy right now. You have to instantiate an object (GroovyShell?) and you pass the script into that. This should let you do what you want though.
On b), there's Groovy shell (groovysh) and a simple Swing app groovy console that act as an interactive shell. They're very basic though - personally I find them kind of annoying. It's easier just to write scripts in an editor.
-Mike
|
|
 |
New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com |
 |
 |
Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6.
(November 2, Article)
SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options.
(September 28, Article)
Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team.
(September 22, Article)
Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies.
(July 14, Article)
JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags.
(June 29, Article)
In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project.
(June 23, Tech Talk)
Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now.
(June 15, Tech Talk)
In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements.
(June 15, Tech Talk)
In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls.
(June 4, Tech Talk)
Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable.
(May 28, Tech Talk)
This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work.
(May 26, Tech Talk)
Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers.
(May 21, Tech Talk)
Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application.
(May 19, Article)
In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources.
(May 19, Tech Talk)
Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)
The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)
|
|