Beta

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Google App Engine Adds Java Support, Groovy Meta-Programming

Soulskill posted more than 5 years ago | from the engines-firing-on-more-cylinders dept.

Google 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."

cancel ×

168 comments

Sorry! There are no comments related to the filter you selected.

Awesome (2, Insightful)

coldtone (98189) | more than 5 years ago | (#27505881)

This really opens the floodgates for cloud computing. I can't wait to port to this platform.

Re:Awesome (5, Funny)

jlp2097 (223651) | more than 5 years ago | (#27506037)

Exactly! We just need to proactively monetize the synergistic potential of this new paradigm of cloud computing and meta-programming by thinking outside the box and leverage these tools to enable a better strategic fit in our forward-thinking, customercentric enterprise.
 
;-)

Re:Awesome (1)

fictionpuss (1136565) | more than 5 years ago | (#27506241)

Buzzwords aside, the ability to try GAE for free and use it for your own tests and experiments is a good thing. I've been much more productive hacking with python/GAE than php/mysql.

Re:Awesome (2, Funny)

Anonymous Coward | more than 5 years ago | (#27506479)

Whoa, FABULOUS acronym!

Re:Awesome (1)

fictionpuss (1136565) | more than 5 years ago | (#27506687)

Whoa, FABULOUS acronym!

Dude, php and sql are acronyms too. WAIAFOA (We are in a field of acronyms). What's your point?

Re:Awesome (1)

Larry Clotter (1527741) | more than 5 years ago | (#27506727)

WHOOSH? I think he was making a joke about how you would say "GAE" like "gay" and then was saying it was a "FABULOUS" acronym (as in the stereotype of gay men saying "fabulous" a lot).

Re:Awesome (1)

Camann (1486759) | more than 5 years ago | (#27506797)

Shh! I was enjoying the breeze.

Re:Awesome (1)

fictionpuss (1136565) | more than 5 years ago | (#27506989)

Whoosh indeed, thanks for clarifying. I guess I need to find me some immature co-workers, cause I'm evidently out of touch.

Re:Awesome (0)

Anonymous Coward | more than 5 years ago | (#27507409)

Don't worry, in my head I pronounced it G-A-E and only went back to it when I was "wtf FABULOUS?"

Re:Awesome (1)

fictionpuss (1136565) | more than 5 years ago | (#27507593)

Don't worry, in my head I pronounced it G-A-E and only went back to it when I was "wtf FABULOUS?"

I'm curious now how Google refer to it internally. Google Widget Toolkit is apparently pronounced "gwit".. so it follows that we both might be doing it wrong.

Any Googlers care to illuminate?

Re:Awesome (1)

gnud (934243) | more than 5 years ago | (#27510515)

Well if they follow the tradition of 'gwit', it would be 'gape'.

Re:Awesome (4, Funny)

Blue Stone (582566) | more than 5 years ago | (#27506521)

I'm concerned that my blue-sky thinking will be obscured by your cloud computing. Any advice?

Re:Awesome (0)

Anonymous Coward | more than 5 years ago | (#27509537)

you have an empty mind?

Re:Awesome (1)

Fujisawa Sensei (207127) | more than 5 years ago | (#27507041)

Exactly! We just need to proactively monetize the synergistic potential of this new paradigm of cloud computing and meta-programming by thinking outside the box and leverage these tools to enable a better strategic fit in our forward-thinking, customercentric enterprise. ;-)

Forget funny, mod parent as Insightful, that one was Brilliant!

I may have to quote you on that!

I may even have to drop it in the "suggestion box", that should be worth at least a couple of points on my Balance Score Card.

Re:Awesome (1)

NeoSkandranon (515696) | more than 5 years ago | (#27508353)

Bingo!

I got:
monetize
paradigm
leverage
strategic
enterprise

Re:Awesome (0)

Anonymous Coward | more than 5 years ago | (#27509123)

Indeed, I do seem some low-hanging fruit here.

Re:Awesome (1)

Luke has no name (1423139) | more than 5 years ago | (#27509789)

I grasp the message of that sentence. Oh no.

Re:Awesome (1)

AKAImBatman (238306) | more than 5 years ago | (#27506117)

Even more to the point, it opens the flood-gates for secure webapps. PHP has the advantage of providing a number of great apps off the shelf that all run on cheap hosting providers. The flip-side to those apps is that you're stuck on the upgrade treadmill as security issues pour out of those apps.

No offense to the people writing these apps. The ease of the platform is a double-edged sword. It's not hard to accidentally introduce security holes in the application. Especially on projects with dozens of developers.

The Java platform is built with security as a core concern and thus tends to have fewer security issues. (Note that I said *fewer*. There's no perfect system, and there's no accounting for poor practices.) Deploying Java-based apps could end up being a boon for getting off this breakneck upgrade cycle.

In addition, Java has a much better system for componentization. PHP apps are often deployed as large sets of files. This has its advantages, but it also means that plugins are often achieved by modifying PHP code. The Java platform is a more dynamic platform that allows for components to easily be plugged in. With Java, adding new features to your blog or forums can be as easy as clicking the "install" button in the admin console.

In short, yay for Google! This is great news!

Re:Awesome (1)

phaggood (690955) | more than 5 years ago | (#27508743)

> plugins are often achieved by modifying PHP code.

Yeep. Tell me about it. A sci-fi writer friend of mine asked me to implement paypal on her RUNNING site; I purch'd a $40 Joomla plugin for the purpose, sat down and started to install it, figuring it to be an hour's effort, tops. As soon as I read 'execute this install script to begin patching [multiple] source files' I ran like an 8yr old Galifreyan from a Time Vortex.

Joomla. Brrrrrrrr. Still gives me the willies.

Re:Awesome (1)

styrotech (136124) | more than 5 years ago | (#27510383)

In addition, Java has a much better system for componentization. PHP apps are often deployed as large sets of files. This has its advantages, but it also means that plugins are often achieved by modifying PHP code. The Java platform is a more dynamic platform that allows for components to easily be plugged in. With Java, adding new features to your blog or forums can be as easy as clicking the "install" button in the admin console.

Nonsense.

What you are seeing that typically Java developers are more likely to be "architecture astronauts" and architect their apps towards componentisation etc sometimes at the expense of simplicity and clarity.

And typically PHP developers under-architect their apps and write them as kludgy non modular spaghetti code.

There is nothing more dynamic than PHP about Java itself - if anything it is the opposite. A lot of the common design patterns in Java are to get around the non dynamic nature of it, and I suspect it is this that makes Java devs far more conscious of architecture than PHP developers.

eg Drupal (PHP) has a very modular architecture and has thousands of plugin modules and has a culture that strongly discourages changing the core codebase. And whaddya know, a lot of the core devs are or have been Java developers and the founder even did a Phd in it.

Either way, if you want to use a pluggable component based architecture for your app you have to design it that way - the language won't do it for you.

Looks like Python (1)

HandleMyBidness (848635) | more than 5 years ago | (#27505961)

After a cursory glance around the Groovy site the syntax seems like python with brackets, yuck.

But... (3, Funny)

MrEricSir (398214) | more than 5 years ago | (#27505999)

But Groovy is NEW! And new is better! Just ask any developer!

Re:But... (0)

Anonymous Coward | more than 5 years ago | (#27508321)

Next step: Groovy on Grails?

Re:But... (1)

ari_j (90255) | more than 5 years ago | (#27508397)

Offer not valid where Lisp is sold.

Re:But... (0, Troll)

z-j-y (1056250) | more than 5 years ago | (#27509967)

actually groovy is very old (since 2003) and nobody gives it a shit - except the 3 groovy guys who spend years spamming about it.

Re:Looks like Python (3, Informative)

hansamurai (907719) | more than 5 years ago | (#27506281)

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:Looks like Python (2, Insightful)

Lord Ender (156273) | more than 5 years ago | (#27508103)

Anyone who has ever maintained perl will tell you that it isn't always the best idea to give programmers the choice of how to do things. If there is a right way, don't give them the option of doing it the wrong way, because many will do so. And if two ways are equally good, just pick one--there's no reason to give people an option!

What about Jython now? (2, Interesting)

Kensai7 (1005287) | more than 5 years ago | (#27509377)

Does this Groovy implementation mean now the end of Jython? If Groovy is so "Pythony", is there a real need to further develop Jython?

What are the relative advantages/disadvantages of Groovy over Jython?

Re:Looks like Python (1)

Keyper7 (1160079) | more than 5 years ago | (#27506297)

I played a little with Groovy some time ago to see what the fuss was all about. Comparing it to Ruby is better than comparing it to Python because Groovy relies on closures in a way very similar to the way Ruby relies on code blocks. The syntax is also closer to Ruby with respect to the "everything is an object" philosophy (numbers have callable methods, etc.)

The main problem I had during my small test drive is that Groovy has a lot of subtleties involving variable scoping that take a while to get used to and it's very, very slow. But the whole concept of using a dynamic language while having all the resources of Java available is quite nice.

Re:Looks like Python (0, Troll)

Zarf (5735) | more than 5 years ago | (#27506307)

If Python does currying, closures, Functional Programming, and also allows for meta-programming and in line Domain Specific Languages, sports the ability to mock hash maps as objects, objects as hash maps, XML data as objects and method invocation as XML building... and perform code cached code synthesis at runtime... then I suppose it is. I don't remember any of that in Python when I used it last but that was a few years ago and a few versions ago.

Re:Looks like Python (0)

Anonymous Coward | more than 5 years ago | (#27506655)

A bit of googling will reveal Python supports currying (see the functional module or a 10 line decorator), closures (a built-in feature, albeit the data is read-only), functional programming, meta-programming, hash maps as objects and vice-versa (objects are just dictionaries), XML data as objects (see just about any Pythonic XML library).

That's what I know off the top of my head.
As for the other features, I'd be surprised if someone hasn't implemented them as a module, given that the language has some of the most powerful introspection features around...

Re:Looks like Python (2, Funny)

Zarf (5735) | more than 5 years ago | (#27506801)

Just goes to prove that Python is the best language ever. Clearly you don't ever need to learn anything else. I strongly encourage you to not learn Groovy as it would poison your mind.

Obviously there's nothing the JVM has to offer you.

Re:Looks like Python (0)

Anonymous Coward | more than 5 years ago | (#27507223)

The JVM offers Clojure. It's Groovy that has nothing to offer.

Re:Looks like Python (1)

Zarf (5735) | more than 5 years ago | (#27507527)

I encourage you to spend your time in Clojure and port it to the Google App Engine.

Re:Looks like Python (1)

Tack (4642) | more than 5 years ago | (#27508993)

I don't think the point was not to bother with Groovy, but that Python mightn't be as useless as you recall.

Re:Looks like Python (1)

vastabo (530415) | more than 5 years ago | (#27507305)

Here is a writable closure for some KML:

def kmlDocument = new groovy.xml.StreamingMarkupBuilder().bind{
    mkp.xmlDeclaration()
    mkp.declareNamespace('': 'http://www.opengis.net/kml/2.2')
kml{
Document{
    Folder{
        name('*** stations')
        description('http://some.place.on.teh.webs/qry')
        open('1')
        stationTypes.each({type ->
            Folder{
                name(type[0])
                description('Station Type: ' + type[0])
                type[1].each({platform ->
                    Folder{
                        name(platform)
                        description('Platform: ' + platform)
                        stations[type[0] + platform].each({station ->
                            Placemark{
                                name(station.name)
                                description('http://some.place.on.teh.webs/qry/station?idtypeabbr=stnid&idvalue=' + station.stnidnum)
                                styleUrl(station.getIcon())
                                Point{
                                    coordinates(station.coord)
                                }
}})}})}})}}}} //lameness filter ate my whitespace; doesn't look like LISP in real life
def f = new File('doc.kml')
f.delete()
f << kmlDocument

The cool thing is that I get all this plus seamless Java integration (i.e. every class in the standard library -- GregorianCalendar, for instance), all my Java tools work, and I can replace lots and lots of boilerplate Java code with one and two liners of Groovy.  So:

ArrayList<String> list = new ArrayList<String>();
list.add("Blah");
list.add("Blah");
list.add("Blah");
list.add("Blah");
System.out.println(list);

Becomes:

def list = ["Blah","Blah","Blah","Blah"]
println list

And hey, with closures, if you want to do something like capitalize the first character of each string in that list it's really easy:

println list.collect({
    it[0].toUpperCase() + it[1..it.length() - 1] //there's a better way to do this; I'm being pedantic
})

Which is not to say that Python couldn't do all that, but Groovy makes life for Java monkeys much easier.

Very cool (0)

Presto Vivace (882157) | more than 5 years ago | (#27506003)

but is this new? [gcn.com]

Basically, GAE is a Google-hosted platform that can run applications written in Python. (Other languages â" such as PHP, Java and Ruby â" are being considered.) With the downloadable software development kit (SDK) and a copy of the Python runtime, you develop your application on a local machine and then upload it to Google. Google will run the app and worry about bandwidth, CPU and storage issues. Google provides a dashboard that allows you to keep track of how often the application runs.

Re:Very cool (1)

DragonWriter (970822) | more than 5 years ago | (#27506157)

but is this new?

Uh, yeah, the actual support for Java, while non-Python language support had been discussed as a possibility for the future previously, is new.

Re:Very cool (1)

Presto Vivace (882157) | more than 5 years ago | (#27506449)

my mistake

Can't spawn threads or make network connections??? (0)

Anonymous Coward | more than 5 years ago | (#27506031)

Can't get very far without these forbidden features...

Re:Can't spawn threads or make network connections (1)

TomRK1089 (1270906) | more than 5 years ago | (#27506237)

Those are the same restrictions Java Applets have due to the Security Manager, and somehow programmers manage to develop useful applets.

Re:Can't spawn threads or make network connections (4, Informative)

AKAImBatman (238306) | more than 5 years ago | (#27506881)

Can't get very far without these forbidden features...

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:Can't spawn threads or make network connections (1)

Furry Ice (136126) | more than 5 years ago | (#27509499)

Servlets don't restrict network connections, and people do it all the time to talk to their database. I know you're not supposed to spawn threads with EJB (because transaction information is kept in thread local storage), but I don't recall anything about not spawning threads being in the servlet spec. I know of a lot of code that does it in various containers without problems.

Re:Can't spawn threads or make network connections (1)

AKAImBatman (238306) | more than 5 years ago | (#27510467)

I don't recall anything about not spawning threads being in the servlet spec.

From the spec:

For example, high-end application servers may limit the creation of a Thread
object to insure that other components of the container are not negatively
impacted.

[...]

It is now a recommendation, instead of a requirement, that the reference to the
request and response object should not be given to the object in other threads -
based on the requirement from JSR-168. Warnings are added when the thread
created by the application uses the objects managed by the container.(2.3.3.3)

You are right, though. I was thinking about the EJB spec, which explicitly disallows threading. With servlets, it's not forbidden but highly discouraged.

Interestingly, the current spec seems to have lightened up on network connections:

Servlets typically run inside multithreaded servlet containers that can handle
multiple requests concurrently. Developers must be aware to synchronize
access to any shared resources such as files, network connections, and as well as the servlet's class and instance variables.

Back before the complete J2EE spec existed, I recall there being a prohibition on making network connections as part of the servlet itself. Generally, you were supposed to use a service of some sort to accomplish tasks that required networked resources. J2EE, of course, provided a number of the required services.

people do it all the time to talk to their database

The proper way to do this in a J2EE environment is to configure the connection in the Directory Server, then do a lookup to obtain a reference to the connection pool. I don't have docs yet for how Google is doing DB connections (something about JDO is mentioned in the brochure), but I imagine it's similar.

Which APIs? Any Database Functionality. (1)

c0d3r (156687) | more than 5 years ago | (#27506089)

I'm curious to know which api's they support.. Sounds like only servlets and mail.. I wonder if its a complete J2EE container, which is pure bloat. Also do they have any standard sql functionality in their hosting solution?

Re:Which APIs? Any Database Functionality. (5, Informative)

nothing2seehere (1496253) | more than 5 years ago | (#27506129)

Reading TFA, it looks like a scalable servlet container. No J2EE as far as I can tell.

Re:Which APIs? Any Database Functionality. (1, Interesting)

Anonymous Coward | more than 5 years ago | (#27506545)

if they can get as functional as tomcat then you can run Spring on it. That counts as J2EE. They also have this thing called Grails [grails.org] which seems to be a web-dev system built around Groovy.

Re:Which APIs? Any Database Functionality. (1)

FatherOfONe (515801) | more than 5 years ago | (#27508377)

Spring isn't really J2EE. It will be with the new J2EE because (I believe), they will make the spec more modular, in that you won't have to have a EJB container. Spring does a bunch of crap, but what most people mean is that it is a light weight container that doesn't require a EJB container to run in. On a personal note why is it that the Spring fanboys are such jerks. I really want to love Ruby and Spring but man their fanboys really wear on me.

None the less, this is fantastic news! Thank you Google.

Re:Which APIs? Any Database Functionality. (0)

Anonymous Coward | more than 5 years ago | (#27509961)

Who cares?

Re:Which APIs? Any Database Functionality. (1)

PotatoFarmer (1250696) | more than 5 years ago | (#27506221)

According to the linked page, it isn't a complete J2EE implementation, which kind of makes sense given the threading and io restrictions specified.

Also, no SQL. Data access is mediated through JDO or JPA. Which also makes sense, given that it's highly likely that the back end isn't a traditional RDBMS.

How about Ruby? (0)

Anonymous Coward | more than 5 years ago | (#27506169)

But when will they add Ruby support?

Re:How about Ruby? (0)

Anonymous Coward | more than 5 years ago | (#27506409)

But when will they add Ruby support?

I expect that the JRuby community will be hard at work on a port. The Groovy community got a leg up as developers from Groovy were brought onto the Google campus to help build this out. Sun is behind JRuby so I don't know if there's a JRuby team on Google campus or not...

Re:How about Ruby? (2, Informative)

ESqVIP (782999) | more than 5 years ago | (#27506859)

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.

cash cow (0, Troll)

codepunk (167897) | more than 5 years ago | (#27506405)

I have no doubt that java and perhaps ruby in the future will be a great cash generator. On GAE you have to pay for processing time, what
better way to generate cash then to run cycle hog java apps on it.

Re:cash cow (4, Insightful)

jaydonnell (648194) | more than 5 years ago | (#27506675)

java is extremely efficient so I have no idea what you're talking about. It's far more efficient than python which is the original GAE platform. I know it's fashionable to bash java on /., but you should at least know what you're talking about. Or, are you suggesting that everyone write their web apps in C?

Re:cash cow (4, Funny)

Camann (1486759) | more than 5 years ago | (#27506877)

Well it would be a great improvement over t

Segmentation Fault

Re:cash cow (-1, Troll)

JamesP (688957) | more than 5 years ago | (#27507089)

java is extremely efficient

ahahahahaha

so I have no idea what you're talking about. It's far more efficient than python

AAHHAHAHAHAHA

I know it's fashionable to bash java on /., but you should at least know what you're talking about.

Let me just say that you don't need to rewrite the bible every time you want to do any operation on python (or pretty much any other language)

Compare this http://code.google.com/appengine/docs/java/datastore/dataclasses.html [google.com]

with this: http://code.google.com/appengine/docs/python/datastore/entitiesandmodels.html [google.com]

Re:cash cow (3, Insightful)

EgoWumpus (638704) | more than 5 years ago | (#27507415)

While your two links are interesting, I think you have to do more work to make your point. Can you cite why those links prove the superiority of Python? And what specifically do you mean by 'rewrite the bible'?

Regarding efficiency, I give you this [snaplogic.org] . The relevant sentence: "I decided to redo several of the tests with updated versions of Python (2.5) and the JDK (Java 6). And indeed, my suspicions were confirmed: Java has made huge speed improvements, and is now faster than Python in almost all cases."

Re:cash cow (0)

JamesP (688957) | more than 5 years ago | (#27507641)

While your two links are interesting, I think you have to do more work to make your point. Can you cite why those links prove the superiority of Python? And what specifically do you mean by 'rewrite the bible'?

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.

Regarding efficiency, I give you this

Interesting link, and yes, Java can be faster than CPython, but GAE probably doesn't use CPython...

Re:cash cow (0)

Anonymous Coward | more than 5 years ago | (#27507821)

GAE uses CPython.

Re:cash cow (2, Insightful)

EgoWumpus (638704) | more than 5 years ago | (#27508105)

*shrug* I'm not convinced that Java is all that more complicated or time-consuming for the developer. And since 1.6, with annotations and generics, I'm not sure that the complaint about inflexibility is really there.

Suffice to say, I don't think that Python is the crystal clear choice. On the other hand, I'm not sure the differences are significant - so it probably is up to your coding (team's?) preference and style.

Re:cash cow (1)

JamesP (688957) | more than 5 years ago | (#27508335)

And since 1.6, with annotations and generics, I'm not sure that the complaint about inflexibility is really there.

Suffice to say, I don't think that Python is the crystal clear choice.

I guess what matters in the end is developer knowledge of the language. :)

I would say one of the biggest advantages of GAE using Java is support for all the JVM languages (like JRuby, Groovy, etc, you could try running Jython as well, just for laughs)

Re:cash cow (2, Informative)

Luke has no name (1423139) | more than 5 years ago | (#27509923)

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 (3, Insightful)

Anonymous Coward | more than 5 years ago | (#27507469)

Let me just say that you don't need to rewrite the bible every time you want to do any operation on python (or pretty much any other language)

Compare this http://code.google.com/appengine/docs/java/datastore/dataclasses.html [google.com]

with this: http://code.google.com/appengine/docs/python/datastore/entitiesandmodels.html [google.com]

Yes, because it's so hard to use the 2 click, automated IDE function to generate all those getters and setters. They aren't required by the language, btw, just for encapsulation. You know, that thing that's one of the selling points of OO.

You write exactly as much code as you do in Python, autogenerate convenience methods (getters, setters, toString, etc.), and end up with your beans. Besides, who cares how hard it is to write a bean class. This isn't exactly the core effort during app development, now is it? How many awesome libraries are there in Java for things like IOC, data access, web frameworks (MVC and otherwise)? There's piles and piles. Are some of them stinkers? Yes, but there's tons of robust, usable, and EFFICIENT frameworks out there. There's tons of free stuff, free app servers, free IDEs, free plugins, free libraries. Some of the best stuff in development was written in Java first (e.g. JUnit, Spring, etc.). This stuff is so good it's been ported to other platforms.

And to boot, the "slow and bloated" Java arguments are belied by the sheer volume of apps out there that are written in Java and you likely have no idea. Check out the networking portion of your favorite MMO game, it's likely written in Java, server side. Tons of banking software is written in Java once you get past the big iron portion. Tons of sites on the web are as well. Some of the biggest, custom forums in the world are Java (WOW forums are).

Yeah, the GP was right, you are ignorant, and don't seem to know what you're speaking about.

Re:cash cow (1)

JamesP (688957) | more than 5 years ago | (#27509271)

Yes, because it's so hard to use the 2 click, automated IDE function to generate all those getters and setters.

I don't depend on a smart IDE to write python code

You know, that thing that's one of the selling points of OO.

You write exactly as much code as you do in Python, autogenerate convenience methods (getters, setters, toString, etc.).

"Write exactly as much" NOT BY A LONG SHOT.(MyClass class1 = new MyClass() versus class1 = MyClass() just for a start) No need for getters and setters in python. Very rarely used, and you can do without (yes, you can write class1.x = 1 and that's calling a setter function)

How many awesome libraries are there in Java for things like IOC, data access, web frameworks (MVC and otherwise)?

Like Django? ORM and MVC for web. IOC? Try first-order functions.

Some of the best stuff in development was written in Java first (e.g. JUnit, Spring, etc.).

Agreed

Check out the networking portion of your favorite MMO game, it's likely written in Java, server side. Tons of banking software is written in Java once you get past the big iron portion. Tons of sites on the web are as well. Some of the biggest, custom forums in the world are Java (WOW forums are).

Well, so!? This site is Perl, twitter is Scala/Ruby, Pownce is (was) Django, etc, etc And yes, my bank uses Java, I know that.

Yeah, the GP was right, you are ignorant, and don't seem to know what you're speaking about.

Go learn about first-order functions and closures first.

Re:cash cow (1)

JAlexoi (1085785) | more than 5 years ago | (#27509833)

What don't you agree about the stated fact that Java is one of the most efficient VMs out there? Python maybe extremely good, but long running applications JVM wins out.
Development speed could be better, but IDE's and other tools make it easier.

Re:cash cow (1)

jaydonnell (648194) | more than 5 years ago | (#27507629)

You completely missed the point. The person I replied to was stating the the jvm is slow and that google would make a fortune because they charge for processing time. Your comment has absolutely no relation to the issue at hand.

Re:cash cow (1)

JamesP (688957) | more than 5 years ago | (#27508309)

I saw your original post, I don't disagree with you, even though the point is moot, efficiency in GAE has more to do with libraries and the code than anything else.

I don't dislike the JVM (ok, I dislike, but it's not the case here), I dislike the Java language

Re:cash cow (1)

jaydonnell (648194) | more than 5 years ago | (#27509001)

Let me see if I understand. You read the original comment about cash cows and efficiency. You then read my reply about the jvm being efficient (in the processor time sense) and you decided to laugh at me because java as a language has poor libraries. Really? Please keep talking because your simply digging a deeper hole. Btw, there are many languages on the jvm. I happen to use jruby and would use that on GAE not java. I'm not a fan of java either, but the jvm is a great platform. This past week I wrote a threaded indexer in jruby using java's util.concurrent library. Try that with regular ruby and C then get back to me.

Re:cash cow (1)

JamesP (688957) | more than 5 years ago | (#27509443)

and you decided to laugh at me because java as a language has poor libraries. Really?

You didn't say JVM, you said Java. :) I'm sorry

Still, saying that the JVM is 'far more efficient' than Python is a little exaggeration.

Btw, there are many languages on the jvm. I happen to use jruby and would use that on GAE not java. I'm not a fan of java either, but the jvm is a great platform. This past week I wrote a threaded indexer in jruby using java's util.concurrent library. Try that with regular ruby and C then get back to me.

I couldn't agree more, and I believe that's THE reason Google picked Java, not for "Java" but for everything else on the JVM.

Re:cash cow (2, Insightful)

jaydonnell (648194) | more than 5 years ago | (#27509893)

You didn't say JVM, you said Java. :) I'm sorry

Clearly in the context of processor efficiency. So now you're claiming that my use of java instead of jvm in the context of processor efficiency leads to a logical reply about poor java libraries?

I know most people that are reading at this point think I should drop this, but I'm endlessly fascinated at the lengths people will go to avoid admitting any form of mistake or oversight.

And the jvm is far more efficient than python. The stuff done with the jit is very impressive.

Re:cash cow (1)

codepunk (167897) | more than 5 years ago | (#27508095)

True that I suppose that if I had never written python applications and only knew java I may think it is the greatest
thing since sliced bread also. However since I have written large applications in both java and python I know better. I absolutely hate
crufty languages and when it comes to cruft java is the king.

Re:cash cow (0)

Anonymous Coward | more than 5 years ago | (#27510311)

you're fucking dumbass and i hope you spend your life doing data entry.

AHAHAHHAHAHAHAHHAHAH

Re:cash cow (0)

Anonymous Coward | more than 5 years ago | (#27507965)

For regular processing & calculations yes, but for GUIs I continually see extremely slugish UIs on slower machines (& by slower I mean a Core2 2GHz laptop w/ 4GB RAM - my Q6600 w/ 6GB of RAM has no problem with it though).

Yes, I constantly hear that you can make fast Java GUIs, but what difference does it make if Java developers don't - that's a problem with the toolkit not making it obvious what is the correct way to build the UI.

Re:cash cow (1)

theCoder (23772) | more than 5 years ago | (#27508205)

Sure, Java is more efficient than Python. But is it more efficient than native code? http://shootout.alioth.debian.org/ [debian.org] has statistics and comparisons for many languages. They wrote the best programs they could to perform different tasks in each language and compared the results.

Java compared to Python [debian.org]
Java compared to C [debian.org]
Java compared to C++ [debian.org]

C++ is slightly faster on all the tests, but not by as much as I'd expect, and Java is faster than some of the C implementations. At best, C++ is 3x faster and at worst it's about the same. Java does have a 10 to 30x memory footprint, though.

So I hope GAE charges by the CPU hour and not the amount of memory used :)

Re:cash cow (1)

owlstead (636356) | more than 5 years ago | (#27509843)

It's rather a different thing to compare speed and memory use for *algorithms*. Of course Java uses more memory for the same structures because of overhead, but the 10x to 30x that you see here are of course not something you see when running any reasonably sized application. And I presume they run only one VM per machine - Java applications may safely run in the same memory space, so the initial overhead just stays a couple of MB.

That said, for smaller applications that have to run on many processors, it may make sense to go for C/C++. This is a place where you may put a *lot* of effort to code a rather limited program. Then again, with C/C++ you have a higher risk messing things up, so you would have to use static code analyzers and unit tests before distributing your app over XXX processors (unless you are that superb C/C++ application programmer everybody keeps talking about).

Re:cash cow (1)

jaydonnell (648194) | more than 5 years ago | (#27510243)

these micro benchmarks don't mean much of anything in all honesty. I'm not sure what you mean by "native code". Java uses a jit so it uses native code for many things. Also, the jvm can make optimizations at run time that no static compiler can.

I'm not a fan of java the language, but the jvm is an awesome piece of software. Sadly I think java the language has given the jvm a bad name.

Re:cash cow (1)

dfdashh (1060546) | more than 5 years ago | (#27508551)

Or, are you suggesting that everyone write their web apps in C?

YES. And you'll like it too, dammit!

Re:cash cow (1)

That's Unpossible! (722232) | more than 5 years ago | (#27506779)

Really, do you think Google is going to deploy an inefficient design to make money on cycles? That seems incredibly short-sighted, far better to offer great performance and sign up more customers.

But that's why they're a company and you're posting anonymous snarky comments from the peanut gallery.

Hmmm... (0)

Anonymous Coward | more than 5 years ago | (#27506445)

In my programming language of choice, meta-programming is usually seen by laymen as pointless mental masturbation. Let's see what happens here...

Groovy? Why not java? (4, Interesting)

WankersRevenge (452399) | more than 5 years ago | (#27507099)

I'm not sure I fully understand the reason for Groovy? I've read a lot of the documentation, but it doesn't answer the fundamental question ... as a java developer, why would I learn this language when I can just use java? Is it just for the new language features? Can someone illuminate?

Re:Groovy? Why not java? (2, Informative)

Anonymous Coward | more than 5 years ago | (#27507309)

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? (1)

Yold (473518) | more than 5 years ago | (#27507461)

RTFA, its from meta-programming! How else would you write meta-programs to run on GAE in the cloud? Just kidding =).

Although I could be way off, I'd assume it allows end-users of your web-app to script additional functionality onto it.

Re:Groovy? Why not java? (1)

LarryRiedel (141315) | more than 5 years ago | (#27507941)

To the extent Groovy is a "superset" of Java, it is a way to have a shell for doing things in Java without having to build; just type in commands at the prompt, or stick them in a file. One way to look at things might be to think of Java as a way to have compiled Groovy, sort of like Cython [cython.org] is a way to have compiled Python. Whether or not the extra non-Java features Groovy provides are worth using... that is debatable.

Larry

Re:Groovy? Why not java? (0)

Anonymous Coward | more than 5 years ago | (#27508201)

That might be a valid complaint except you clearly haven't ready the summary - they support Java too (actually Java was announced first).

Re:Groovy? Why not java? (2, Informative)

dfdashh (1060546) | more than 5 years ago | (#27508723)

I was forced to learn it for the job (Quest Foglight uses Groovy for its internal ruleset), but I ended up liking it for its:
  • Interactive console
  • Perl-like regular expression support
  • Optional typing
  • Support for "for i in $array" syntax

Re:Groovy? Why not java? (1)

JediTrainer (314273) | more than 5 years ago | (#27509279)

Support for "for i in $array" syntax

Agreed with most of your points, but this one has at least been improved in Java (6?) with:

MyObject[] myObjectArray;

for ( MyObject o : myObjectArray ){

}

Re:Groovy? Why not java? (5, Insightful)

jekewa (751500) | more than 5 years ago | (#27508913)

Still funny.

Groovy is to Java as PERL is to C. Many similarities, plenty of points of comparison, some interactivity, arguably some interchangeability. It is not a "super set" or even an extension. It's a new language, written in another language. It's a scripting tool, written in Java, that optionally generates Java for execution not in a Groovy engine.

It doesn't give you "compiled Java" any more than Java gives you compiled Java, and other tools (like gjc) give you native executables from software written in Java.

It's got good. It's got bad. It's new. It leverages old. If you're going to use it, you've got to learn it.

No magic, just different.

Making Java as unreadable as Perl (2, Funny)

heroine (1220) | more than 5 years ago | (#27507917)

Surely there is a way to make Java even less readable than Groovy. Maybe make the entire language pure regular expressions or allow every character including the . to be an object.

One outcome of Sun's future liquidation is that no-one is around to promote the 1 Jesus language & Java ends up fragmenting into thousands of derivatives like Linux or Fortran.

Re:Making Java as unreadable as Perl (0)

Anonymous Coward | more than 5 years ago | (#27508983)

does it hurt to be that stupid?

Re:Making Java as unreadable as Perl (1)

Luke has no name (1423139) | more than 5 years ago | (#27510013)

I don't know if you're trolling or not, because I don't know what you're trying to say.

Sun isn't going to die, it will survive or get bought by someone whose interests are in making money off Java and Sun's other product offerings better than Sun could.

ta30 (-1, Redundant)

Anonymous Coward | more than 5 years ago | (#27508549)

be in a scene and arogance was

groovy? why!? (1)

recharged95 (782975) | more than 5 years ago | (#27508633)

They would be better served if they offered scala support. I notice a movement toward scala/groovy code frameworks vs. the Ruby/PHP ones lately.

Then again, Groovy is very popular now, where as Scala is becoming (as per the twitter announcement yesterday).

Re:groovy? why!? (1)

pohl (872) | more than 5 years ago | (#27509127)

Scala

- Scala works out of the box.
- Scala Actors do not work, because they are implemented using Threads (which are not supported).
- The Lift web framework does not work out of the box, because it depends on Actors and JDBC.

Google App Engine now with PHP (1, Interesting)

Anonymous Coward | more than 5 years ago | (#27508793)

For all you PHP folks out there, GAE + Java + Quercus means PHP is now on Google App Engine: http://weirdhenge.appspot.com/test.php [appspot.com] ... once you have Java on a platform a whole world of tools just opens up!

Does Groovy... (0, Offtopic)

Vahokif (1292866) | more than 5 years ago | (#27508965)

...do anything that C# hasn't for a while now?

Re:Does Groovy... (1)

dyefade (735994) | more than 5 years ago | (#27509805)

Yes, apparently you can now use it on the Google App Engine!

Re:Does Groovy... (1)

Luke has no name (1423139) | more than 5 years ago | (#27510063)

It's open source and not half-assed open spec in a thinly veiled excuse to call itself cross-platform.

It's dynamically typed, which C# doesn't have, though C# 4.0 will have the static type "dynamic".

Other than that, I don't know. P.S., I don't really hate C#.

Re:Does Groovy... (1)

Vahokif (1292866) | more than 5 years ago | (#27510213)

C#'s spec is fine, Microsoft has a look-but-don't-use "shared source" implementation of the CLR, and officially supports Mono, which supports virtually everything people actually use. What more could you want?
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?
or Connect with...

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>