Google App Engine Adds Java Support, Groovy Meta-Programming 168
Zarf writes "Yesterday Google announced that the Google App Engine now supports Java development, and fast on the heels of the Java announcement is an announcement for Groovy support! Groovy is a dynamic programming language for the JVM that is a near super-set of Java. Much Java syntax is valid Groovy syntax, however, Groovy adds powerful meta-programming features, and the new functionality will bring these meta-programming features to App Engine development. Groovy got special attention from the SpringSource Groovy team and the Google App Engine Java team, and it was this collaboration that helped create the changes that were the big secret in the recent Groovy release of 1.6.1."
Re:Which APIs? Any Database Functionality. (Score:5, Informative)
Re:Looks like Python (Score:4, Informative)
Well, it's biggest advantage is that it is a language written to run on the JVM*. You can talk to Java classes when you need to, but it's really a dynamic language that Java developers can easily learn and use. Type can be strong or weak depending on what you want/need, you can write Groovy unit tests against Java code, etc.
*of course there's Jython, but Groovy was designed from the ground up to be used by Java developers.
Re:How about Ruby? (Score:2, Informative)
http://blog.bigcurl.de/2009/04/running-sinatra-apps-on-google.html [bigcurl.de]
Should get you started.
Re:How about Ruby? (Score:3, Informative)
http://olabini.com/blog/tag/gae/ [olabini.com]
In fact, you should thank ThoughtWorks guys for several of the recent blog posts on GAE involving JRuby, Groovy and also Clojure.
Re:Can't spawn threads or make network connections (Score:5, Informative)
Incorrect. The Servlet platform imposes those restrictions already, with the container handling all the messy details of threading and networking. It works just fine in 90%+ of the cases.
Re:Groovy? Why not java? (Score:2, Informative)
Java is my main language, but I definitely see the value in Groovy. For instance, how do you pass functions or other code blocks around in java? You either use very clumsy and verbose anonymous inner classes, or.. or nothing. Groovy handles this gracefully.
Basically Groovy is a scripting language that lets you use java classes. It's not really much different than Jython or JRuby, it's just more java-like in syntax.
Re:Groovy? Why not java? (Score:3, Informative)
Re:cash cow (Score:2, Informative)
My beef is with the amount of code that has to be written, and the inflexibility of Java.
You just build a class on python, few includes, you're done. Not like Java. Also, no Expando in Java.
There's Expando in Groovy. And Groovy seeks to remove a lot of the syntactic clutter of Java. Read a Groovy book or intro and you'll see its benefits; it's got a lot (most) features of Python/Ruby, etc., while using and being completely compatible with Java.
Re:cash cow (Score:1, Informative)
There are plenty of situations where Java is more efficient and better to develop in than Python...
Java has the memory overhead and startup time of the JVM, but once it gets going it wipes the floor with Python - 5-10x faster for any intensive workload.
The Java API is better documented and thought out - and stays backwards compatible. Sure, Python's is more minimalistic, but that's only because it's a bit of a hack job. I like Python, but it's frustrating when they can't even get basic stuff right in the API like having a consistent interface for bzip2 and gzip compression...
It's generally easier, in my experience, to verify the correctness of Java - given that it's a static strongly typed - and the development tools are more mature.
Python's usually better for toy projects, and as a scripting language in the real world, but if you're actually engineering a system... Java (or C/C++, etc) has some serious advantages.
Re:Groovy? Why not java? (Score:3, Informative)
Dynamic languages are gaining popularity extremely fast for a whole host of reasons. If you haven't used a dynamic language then you probably won't understand why they are attractive very easily, but if you have it will probably seem obvious. They do have a lot of downsides and I think the jury is still out to some extent whether the reams of code now being written in them is going to be maintainable down the track.
Groovy is Java made into a dynamic language and with innumerable convenience features added. The best way to describe it is to imagine if java was turned into Ruby.
I suspect one reason Google has focused on it is because of Grails, which is java's main player in the RAD web-app development arena (more or less the equivalent of Django, which they also support for the Python app engine). It doesn't work on App Engine yet, but I strongly suspect that is where they are headed.