Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I noticed that this was asked in the following post. Has anyone used both and can conclusively tell me which is better? It seems like python might be a little easier to implement and faster?
By this time, both implementations are reasonably mature and solid, and their functionality is pretty similar (I don't think it's quite 100% equal yet, but, moving in that direction). So, if you already know only one of the two languages, I'd say "just go for it". If you already know both, you don't need my advice;-).
If you know neither, but are rarin' to try some of the non-Java languages that are (more or less;-) supported on the JVM side of GAE (I believe this includes Scala, server-side Javascript, JRuby, etc), then it's worth trying. If you know neither, and don't want to risk a "not-first-class-supported language", I'd definitely agree with your observation that Python's faster to learn (but of course I'm biased in favor of Python;-).
I have used both, and my conclusion is that biggest difference is in libraries. In theory both have good libraries to do almost everything but in practice many libraries don't work with app engine:
All Java libraries are pure Java and should work, but as app engine does not allow threads and not even all *java.** dependencies it is... lets say problematic.
Python on the other hand have way less libraries out there, and many are just wrappers for native C libraries, which don't work either. :(
As both versions have such bad support for libraries, I call it tie. For very simple "just to show some content" -web app you don't need any external libraries of course.
I use now Python because it rules. ;)
"Better" is always subjective. For GAE, the choice of which is better for you depends on what you're most familiar with. If you've got experience with Java, use that, and if you've got experience with Python, use that. I don't think there's any objective criteria that would point to one being "better" than the other.
Its not just the language that you need to consider here. Libraries, frameworks, and tools are also relevant factors.
If you have no background in either language or web development, I would suspect Python would be easier to get off the ground with. It has been around longer, there is likely more support and knowledge available. Doing something simple is generally simple to do and the Python framework is in my opinion more lightweight.
Despite this, I would rather use Java. However, my reasons are controversial and I don't want to troll :D.
Python was the language Google AppEngine was originally designed for, and it has been supported for longer than Java (which only got included comparatively recently). Additionally, Guido van Rossum, the creator of Python, works on the Python side of AppEngine. The same can not be said about Java's creator.
It seems that there is more documentation and articles about Python on AppEngine than Java, probably because Python has been used in AppEngine for longer.
My advise: Use Python.
But that doesn't mean Java is a bad choice, because it is not, I just think Python is a better choice in this instance.
Python ( subjectively speaking )
.py chosen here for all gae projects for reasons more readable, less lines code, higher level same time java has more ways to solve a given problem. Approx estimate same function with python is 1/10 the code compared to java.
i use python, becouse always can get the best of django in appengine
I use Groovy (Grails) with GAE. It has Java's library universe and you should have roughly the same LOC compared to Python. Yeah, its not 100% Java (if you want to), but very close.
The BIG difference is roughly the JavaVM speed, that's one of the reasons Groovy (Grails) has gained so much popularity - especially people like my who dislike Python .)
It maybe possible to use Jython in appengine so you could use both. One thing I would say about the python productivity vs Java productivity argument is Java has excellent IDE's to speed up development where as Python is really lacking in this area because of its dynamic nature. So even though I prefer to use Python as a language, I don't believe it gives quite the productivity boost compared to Java when using a new framework. Also I have as yet not been able to get the python version of google app engine to work in Netbeans which is a royal pain.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I have a history of hating Java, having used it pretty regularly in the late 90's during the 'slow as balls' era. As such, I never really learned it well. From what I understand, Java is actually a pretty good language to use these days. I've been thinking about diving into it because of Jython and Clojure. That is to say, I'd like to program in Java and use inline Jython or Clojure where appropriate. But truthfully, I'll probably just be programming in Jython/jRuby and calling up clojure from there.
Which brings me to my question. I know both of these languages can be called from Java, but is that necessarily good practice? Should I even bother learning java if I just want to use Jython as the primary language? Seeing as how that's a large part of my motivations here, I'd like to know that I'm not terribly misguided before jumping in. I'm aware there is a very high risk for projects to become a kludge if done in multiple languages like this.
I'm still learning about the JVM and the like, so I apologize if this question is painfully obvious.
Jython can be viewed as a cross compiler from Python to the Java Virtual Machine. As such, to get the most out of Jython you'll obviously have to learn Python, and probably will need to learn Java.
You can skip some of the Java learning, but at the end of the day, Java and the JVM grew up together. That means that Java code tends to lend understanding of the JVM. It is possible to gain understanding of the JVM without Java, but that's not a path well travelled. Any Jython code that imports a Java library will immediately have you searching Java documentation, so if you avoid leaning Java you're going to learn it piecemeal anyway.
You will have to decide if a piecemeal approach or a formal approach is more appropriate for you and your situation. A lot of deciding which path to take is knowing how you learn best.
As far as the "slow as balls" period of the 90's, that's when I was learning Java. Personally, I feel it is better to describe it as "slow as balls if you did incredibly stupid things with Java". Now I think people have built up a sufficient skill set to avoid translating C directly into Java. That said, I do occasionally encounter the 2000+ line method, so perhaps I'm being a bit rosy in my projection. The entire JVM is laid out in such a manner that good object oriented code runs faster, and if you're constantly trying to go to "other" objects for all the data you need locally, you'll just stack thrash the JVM.
Regardless of opinions, the JVM is now the hot Java item. There has been "other language" support by one means or the other for over a decade now; however, the excitement around Domain Specific Languages seems to have sparked an interest in compilation technologies and the JVM. The other languages benefit from the JVM being an easy target to hit with built-in cross platform support, excellent performance, huge availability of libraries, and generally good documentation. Learning Java and the JVM will help you with a lot of the JVM supported languages, as many of them don't flesh out their library space in favour of hooking into a pure Java library.
I'd say it's worth knowing Java even if you plan on only using other JVM languages. I use JRuby and Scala, and have played around with Clojure. If you are building things to run on the JVM, knowing Java is a bit like knowing C when working natively–you don't have to know C, but if you do, you can write the bits that need speed in C and wrap them in a Ruby or Python library or whatnot.
It's worth knowing the basic principles of how Java works in terms of things like interfaces and annotations and how the classpath works because otherwise you are working with basically a leaky abstraction. What happens when your interop isn't very good? This is especially true if you are planning to do Clojure and Jython!
The other reason to know Java is simply because if you are using code in the Java ecosystem, you have to be able to read and write Java. You need to write a library? Yes, you can probably write it in Clojure, but if you want other JVM language users to be able to use it, you should probably have written it in good, idiomatic Java. Scala is close enough to Java for this purpose; Clojure or Ruby or Python, not so much. Just being able to read and comprehend Java programs is very important too.
The other great benefit is simply that you get more libraries and they are better tested. You need a double-ended queue? Check the Java Collections Framework. Good random number generation? java.security.SecureRandom. UIs? Well, Swing, AWT and SWT are... okay, bad example. Knowing the benefits and shortcomings of these only comes from doing some Java programming and learning the various ways not to suck at Java.
From a couple of years experience of using Clojure (plus many more years of Java...) here is my perspective:
You don't strictly need any Java experience to write Clojure code - Clojure is a full language in its own right and you can write perfectly capable programs without using any Java.
You will need to set up the JVM environment - the Java environment has some rules about where code gets loaded from (i.e. the "classpath") that need to be followed to get a working environment. Not a big deal, and most IDEs will do it for you, but it can be a hurdle for people completely new to the JVM world. I'd suggest careful following of the setup instructions for whichever IDE/toolset you choose.
There are some Java-related concepts that are helpful to understand - for example, Clojure harnesses Java exception handling features with (try ... (catch ...)) etc. so it's useful to be somewhat familiar with the Java approach to exception handling.
Ultimately you will probably want to use Java APIs - bacause a huge amount of the value of being on the JVM in the first place is in having access to the huge diversity of libraries and tools that are available in the Java ecosystem. You don't need to write any Java code to use Java APIs from Clojure, but you do need to know enough Java (method signatures, data types etc.) to be able to read the JavaDoc documentation of the APIs and convert this into an appropriate Clojure function call. Often, this is as simple as (.someJavaMethod someJavaObject param1 param2) but sometimes it can be more complex (e.g. when you need to instantiate a subclass of some Java class to pass as a parameter)
Java isn't a bad language to learn anyway - while I'll readily admit Java has some weak points (as do all languages!), it's still a great, simple, high performance, cross-platform, object-oriented language that has a lot of value. Even if you only do a few short tutorials and never write anything substantial in Java, I'd still recommend it for the learning experience.
I believe most of the above would also apply to Jython.
I can't speak for Jython, but if you want to really get to grips with clojure, you want to understand its trade-offs compared to Java, especially wrt memory/gc and the basics of Clojure/Java interop. You also need at least an abstract understanding of how the clojure collections are implemented unless you really don't care about performance - that's not to say that clojure is particularly inefficient, but more the opposite: the implementation of its immutable collections is fairly unique and tailored to clojure's stance on persistence and performance and it helps to understand the underlying details when you're trying to improve on performance issues.
For all of that, I don't think you actually need a lot of Java knowledge. Being able to read Java fairly well, a basic understanding of the concepts, and a knowledge of where to find the documentation is probably enough.
I think if you want to do a hybrid Clojure/Jython project the interoperation details are most crucial. That probably means you have to know in some detail how classes, interfaces, some of the standard library and (to a minimal extend) generics work in Java and how to deal with all of those in your chosen languages since the interoperation necessarily reduces to the more basic Java constructs. Some of this is tricky and can be confusing, and in clojure's case at least the documentation often refers back to Java concepts and documentation for obvious reasons, so you have to make sure you read both, closely.
I would definitely learn java and learn it well, not only because Clojure is built on top of the JVM but also to get anything done you will be calling Java libraries all the time, and you may even need to dip into Java occassionally.
On another note it would be expand your mind to understand Java's OO concepts and pain poaints too and this will enhance your undersatnding of Clojure too.
Above all, study the Java libraries. Part of the joy of using the JVM is having access to "it's already been done" libraries, as well as to parts of the core language that accomplish certain tasks with optimum performance on the JVM. In addition, some languages (e.g. Clojure) purposefully dip directly into Java and don't completely discourage it in your own code, so if you want to be able to read others' code Java basics are a must.
As for the rest of "learning Java" (design patterns, concurrency in Java, etc.), I wouldn't waste your time unless/until specific projects requirements demand it.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I just got myself an android phone and I'm dying to start coding on it !
However I'm not a big java fan, although I can live with that, I would like to know if there're reasonable alternatives for the android virtual machine.
I've done a medium sized project using clojure, however from the reviews I read, it's very slow when running on android. How about scala ? I read that some people did experiments with it in android, is it "fast enough" ? How big is the learning curve ?
Cheers,
Ze Maria
There's the NDK which allows you to write parts of your program in C or C++.
There's ASE that allows you to write scripts in python and maybe other languages. There's no python compiler despite you might hear otherwise.
I have read something about scala but since I wasn't really interested I did not pay attention.
There's definitely quite a few people doing Android development in Scala. Of particular notice, there's even a plugin for SBT, the prefered builder for Scala projects, with Android-specific targets.
As for learning curve, I can't speak for Android development itself, as I haven't done that. As for Scala, you can be productive very quick, but learning all the particularities of the language takes time. You don't need to learn all the particularities -- I have seen people write non-toy programs with barely any experience -- but some people can't stand not knowing something about the language they are using.
Also, a lot of Scala code out there is very declarative. If you look at the SBT build files, for example, they are mostly declarative. Some people get very upset by that, for some reason.
I'm guessing what I'm trying to say is that it depends mostly on you how well you'll take to Scala.
As for speed, Scala code can be as fast as Java code, though that may call for avoiding the more high level abstractions in exchange for uglier, but fast, code. It depends a lot of what kind of computation you are doing, though.
Android 2.2 adds jit to the VM which is supposed to make loading Clojure programs much more efficient. Clojure produces a lot of small classes which take a while to load when the android program starts up. this should be alleviated with the enw android though its not intolerable now.
Just noticed that some Scala examples can be found in trunk: http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/docs/android-examples.
I haven't tried myself but it's encouraging.
There's a port of JRuby to Android, as well, which I've played with and seems interesting. http://ruboto.org/
"fast enough" - you are running applications on a mobile phone that question relative to what you expect it to do.
Also java's performance has been increased through the years. But also run you are just coding in java. Google has created a tool that take java byte code and converts it to .dex (Dalvik Executables). Dalvik the VM implementation that java used is optimized for this platform. Which mean you can program in a high level language like java which provides many helper classes which means you will be more productive.
They do have a NDK but I believe you have to still have a java front end and have your java code call the NDK code when necessary. You pretty much only want to write the native code when you really need to optimization. Alot of java classes like java nio and the opengl classes are just wrappers to low lever calls that use hardware resources directly.
I probably over answered you question a little.
There is also Lua, which you can use with the Corona SDK.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I need to have an at-home project now that I'm working on Python/Django at work. I'd like to learn something new, so I was thinking of checking out Java.
What's the most well respected web framework for deploying Java web apps?
The only reason I'm not checking out ruby on rails is because of how similar the ORM and other parts are to Django.
Alternatively, does anyone think I should take a look at seaside/smalltalk? Can anyone explain why I should?
Haskell is something I'll consider if anyone can make a good argument for it. I'd need a web framework and database access library to go along with it though.
I'd consider factor/forth if I wasn't so accustomed to the stack paradigm via x86/asm. I'd be willing to hear any counter-arguments to this as well.
See also: http://www.reddit.com/r/programming/comments/9v3uf/asm_c_python_perl_lisp_scheme_programmer_looking/
With that range of skills, why don't you learn something more outside your comfort zone, like carpentry or painting, or any of hundreds of other skills that have little to do with your field.
At some point, all languages are the same and you'll get scant benefit from learning another.
Whereas, with something totally different, you will become a much more well-rounded individual. I, for one, like painting and golf, even though I'm not that good at either of them - when I asked my golf instructor what my handicap was, he said it was an inability to hit the ball straight :-)
I find that I enjoy doing stuff I'm not accustomed to since it's a genuinely new experience. Learning another computer skill is a easy thing to do after a while and hence the pleasure from doing it is reduced.
Don't get me wrong, I like to keep up with developments in the field but, for the most part, the brand new technologies give nothing to my career since most work I do is on stable technologies. You may be in a different situation.
Haskell is pretty popular these days as a mind-bender, though it may not hurt as much for you if you already know Lisp and Scheme. It's purely functional, so there are no side effects to anything. You have to use monads to print text and do other things that require a certain order. It's also completely lazily evaluated, so you can make infinite lists in Haskell and not have to worry about memory consumption.
The Haskell Platform may not be fully complete, but is intended to be a portable set of libraries for Haskell. It's list of packages includes some for CGI handling and (X)HTML generation.
Sounds like you're into web programming, so smalltalk/seaside is a great one. IMO everyone should learn smalltalk even if they never use it, and seaside is a really different web framework than what you are used to. Django, fer instance, is all about REST, while the seaside philosophy basically says "to hell with REST."
And if you've never coded in an image based environment there's just something about it that seems... natural, magical even. Lots of IDE functionality that originated in smalltalk have been implemented in file based language IDE's, but it always feels like an unnatural grafting, where those same features feel as if they simply belong there in smalltalk.
Check out Pharo. Give it enough time to get used to the fact that there's no menu bar and see if it doesn't grab you.
I do suggest Java. When I was looking for a job, I noticed lots of openings for Java developers, so there's a lot of it out there, and you might someday have a chance to use your Java skills.
And then you should try out Scala. Scala is a sort of Python-ish language that uses functional programming to make very scalable programs. Unlike Python, in Scala you do need to declare types of things. Scala runs on the Java Virtual Machine so it can be used in Java shops.
http://www.scala-lang.org/
It's possible I'm just giving you this answer because these are the next two languages I intend to learn, myself.
You probably should also spend a little time playing around with Javascript. Javascript was sort of intended to be a "stealth Lisp" and I imagine you would pick it right up.
http://www.crockford.com/javascript/javascript.html
http://bc.tech.coop/blog/030920.html
And heck, have some fun with it. Write a game or something!
From your list I'd say you are due for a completely object oriented language.
You could check out Ruby, but I'd recommend JavaScript since it offers a lot of interesting things you probably wouldn't expect, like support for closures, higher-order functions and prototypical inheritance - plus it's kinda fun and becoming very popular.
I'd need a web framework and database access library to go along with it though.
If all your programming is based on web frameworks and SQL databases, you will only be solving the same problems with different syntax if you switch languages.
Build something using a different data model - Prolog, Conceptual Graphs, RDF, Linda/JavaSpaces, XQuery, HDF5, ASN.1, or a different network model - XMPP pub-sub, SNMP, a zero-config mesh or a swarm of ZigBee enabled Arduinos.
Maybe look at languages like Oz, Io or Erlang/OTP, which are distributed rather than primarily monolithic like the ones you mention.
What about the Java Spring framework?
http://www.springsource.org/
Or maybe NHibernate?
http://en.wikipedia.org/wiki/NHibernate
At the end of the day its up to you. As I only listed two out of many. When I am programming a static language professonally... I try to learn a dynamic or scripting language. And vice versa.
Also, I try to learn something totally different or outside my realm... maybe even Powershell or Korn shell or ActionScript.
What's the most well respected web framework for deploying Java web apps?
There is no single web framework more respected than others. Struts2, Spring MVC, Stripes or Wicket (which is event based) are all good candidates (I personally like Stripes). But you'll need a bit more for the persistence (Hibernate or JPA) and for the glue (Spring).
Grails (Groovy on Rails) is another good option.
Alternatively, does anyone think I should take a look at seaside/smalltalk? Can anyone explain why I should?
Well, I guess that learning Smalltalk can't hurt but I don't see a good reason to choose Smalltalk over a moderner language like Java. Regarding tooling, I don't know anything in this field except VisualAge for Smalltalk but, personally, I'd really stay far away from it.
Haskell is something I'll consider if anyone can make a good argument for it. [...]
Looks like I'm not the right guy for that.
I'd consider factor/forth if I wasn't so accustomed to the stack paradigm via x86/asm. I'd be willing to hear any counter-arguments to this as well.
Same as above.
I would have suggested mastering Lisp (in some relevant dialect) so even if you have Lisp and Scheme on your resume, it might be worthwhile to REALLY learn deeply. See http://www.paulgraham.com/avg.html for reasons why.
Otherwise Prolog might interest you. It is related to SQL but for programming instead of communicating with an organised set of data tables.
If you want to target web technologies I only have experience with Java. Here the newest Java Server Faces (JSF) allow for using Ajax to update pages, and Google Web Toolkit allow for very rich component based web pages. These might be juicy enough to interest you enough to learn enough Java to find them fun :)
I don’t see C# and the .NET platform on your list. And I am surprised no one mentioned it yet.
I have worked in C# for 5 years. I have looked at some Java code but I have never coded in it. I believe that Java is somewhat similar to C# enough so that if you become proficient in one I think you could pick up the other is a matter of a few days.
One idea might be to create your own language / compiler. The one I would like to create (or see created) would be an Assembly Language level compiler with an object oriented syntax that would be very much like Python… but make it typed language. You could start with the basic raw binary types db, dw, dd, and then add on to these … The functions and methods could have assembly language freely mixed in the high-level code. Now, that would be a fun project, I think ?
Definitely try Haskell or Smalltalk or Forth.
I would say Smalltalk would be most useful while Forth would get you away from the x86 asm and C bullshit. There's more than one way to code close-to-the-hardware stuff.
Why don't you try OCaml? And if you ever happen (sadly) to return to .NET world - you will have knowledge of F# in your baggage.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
So many server side and the mobile Java applications use the native Java language for Java. Can we use Jython instead to build the enterprise applications, e.g. websites, application servers etc.
Also what do you feel about Java ME applications in Jython.
P.S. Comments on question also welcome.
No, Jython is not a suitable replacement for Java. Consider, for instance, that it provides no way to implement interfaces without writing the interface in Java and then writing a class leveraging it in Jython.
What's needed is a JVM-targeted equivalent to Boo. Boo is a language targeting the .NET CLR which is roughly inspired by Python but not compatible, and which fully exposes the CLR's functionality (thus being feature-equivalent with C#). There presently is no Pythonic language with feature parity with Java -- and such a language would necessarily be incompatible with Python, as Python simply doesn't provide a way to express some of the relevant concepts (such as interface typing information).
Since there have been some questions about this, yet me clarify:
Jython is not a replacement for Java in the sense that you can't take an arbitrary Java project, decide to implement a random subset of that project in Jython instead, and not have anyone else on the development team know or care. Certainly, Jython is suitable for many of the same classes of projects that Java is, except when you're building an interface which will be called from Java, rather than the reverse. Given as "enterprise applications" tend to have a lot of components which operate closely with each other, being able to build a class with an arbitrary external interface is important... and is something which isn't readily done in pure Jython.
It depends largely what your requirements are. All languages have their strengths and weaknesses. There is no perfect language and making intelligent decisions about language choice is an important skill for a programmer.
I disagree with Charles that Jython can't replace Java because you can't implement Interfaces. In dynamic languages, it's seen as a feature that you don't need Interfaces (see duck typing).
Jython takes the great language features of Python and combines it with easy access to huge collection of Java libraries. However it does have a price in terms of overhead, and being a fairly new language you have less programmers and support to back you up.
The nice thing about Jython is that you can rewrite individual modules in Java if performance is a problem. The speed issue is less notable on servers where you can throw hardware at the problem. On mobile phones, performance is still key and I can't see Jython making a big impact there in the near future.
So will Jython replace Java? No, I don't think it will - the momentum behind Java is too great. But we will see increasingly more software with parts written in Jython and other languages targeting the JVM.
No, Jython cannot replace Java, because Python is dynamically typed. Yes, Jython can be used for server applications.
Jython is not good for Java ME, because Java ME has very limited resources. Maybe several years later.
Edit: dynamically typed, not weakly
Yes. The Dynamic languages are the future. I heard this from SUN representatives about one yar ago. The amazing part about Jython is "native" usage of java libraries.
Services and other components may remain in Java but integration layer will move for sure in the dynamic languages direction.
I think Python is natively object oriented like Java that's why they match so good.
I don't expect something like that from other scripting languages like Perl but for sure Ruby and Groovy are also good alternatives.
You can use Jython for that domains.
Obviously, the world for web development is moving towards dynamically typed languages as Python or Ruby. Jython is nice in this domain, since it allows to use the complete "Java stack" (App server, Tomcat, deployment and testing infrastructure,...) in enterprises. You can also implement your business logic in Java.
However, Jython is not a replacement for Java as it is C#. You (may) gain programmer productivity, but you lose performance and compile time checks. The languages are really different and are "optimized" for different tasks. I would propose to evaluate Jython for smaller, non-critical tasks, e.g. by starting to implement some test cases in it.
I doubt that Jython is useful for Java ME development. The reasons are given in the other posts: Resource constraints.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What is best language to learn next to Java?
Criteria for this secondary language are:
High potential of being the "next big thing". e.g. If the market for Java open positions hypothetically dies/dwindles, what is the next programming language that will have a bigger market for open positions? Another way to frame this question is: If I own a small company that implements solutions in Java, what is the other language that I should use?
Can produce web applications.
Can produce desktop applications.
Easy and fun to learn.
Wide range of available libraries and frameworks (free or open source) that enhance and speed up your solutions.
Python almost meets all of them, but I don't know about being "the next big thing", but hey, Google uses it, and I think its popularity is raising.
It's a scripting language, btw.
I use it for web applications (using django), and you can definitely create desktop applications with it (although I haven't done that myself).
It is easy and fun! (although this is quite subjective, but it's tons easier and "funner" than Java)
For employability: Any of the .Net languages, probably C#. Then you're well set for most potential customers.
For stretching yourself: something functional (F# to cover .Net too?), or something Lisp, or Smalltalk - was once the next big thing but it probably never will be again, but still a language that changed signficantly my approach to programming in other languages.
If you are expert in java, you will probably really enjoy groovy.
It is backwards compatible with java and has a lot of the nice features of ruby and similar dynamic languages. It also has what is shaping up to be a nice rails-a-like in grails, and a good object-relational mapping framework in GORM.
What is really nice about it is you can mix and match groovy classes and java classes. So if you find yourself forgetting the groovy syntax, you can just drop into Java. And of course you can get at any Java library from it. At the same time you can benefit from groovy's really concise idioms for things like Beans properties.
(By the way it meets all your criteria listed above, too)
Learn a language that will probably not be the Next Big Thing™. Learning a new language usually means learning new concepts (unless you learn one that's very similar to another one you already know).
Learning new concepts has great advantages, no matter which language you program in, so it's a pretty good thing to do.
If you limit yourself to a language that's going to be the Next Big Thing™, then chances are that you'll find a lot of familiar concepts and only relatively few new ones (the IT world is conservative like that).
Learn something that looks interesting to you. Not only will you be able to learn faster, if it's interesting, but you'll also have more fun doing so!
How about Scala or JavaScript? Functional paradigms will stretch your thinking further and will be of benefit whether they are "the next big thing", or not.
Go for a different paradigm : functionnal, lisp, haskell, ocaml, erlang, scala, etc.
If you don't have any religious issues with Microsoft, I would argue for C#.
The only downside I can see is that it's not cross-platform. Otherwise it fits your requirements as far as I can see
Your criteria fairly closely matches Python and Ruby, they both have a growing market base in Web development, and are fully capable of producing desktop applications as well. Whilst they are fairly closely matched, Python has a slightly larger library of re-usable code modules, whilst Ruby's strength leans more to it's well-established frameworks.
As a side-note, You should ensure that you don't stop at 2 languages. Start learning a second one, then pick up a third and even fourth as you progress. Learning new programming languages becomes a more trivial task as the general learning curve evens out.
I must second Gilles here; to learn a different paradigm is very rewarding, and functional programming is [not unlikely to be] the Next Thing.
Erlang is great both in flexibility, ease of use (once you grasp the basic ideas) and - the best of all - it it very well suited for the high parallelism of future and current hardware. It also covers all your five criteria, though it might be more of a "server" language than a "desktop" language.
If you are interested, I suggest the book Programming Erlang by Joe Armstrong.
Personally, I'd go with Ruby and focus on running your Ruby scripts under JRuby. this way you get the expressiveness of Ruby with the JVM running your code. I've seen Rails and Merb running under Glassfish. Might seem odd, but you get all the nice instrumentation of Glassfish with your Ruby code. Things like JMX, RMI, etc. work well with JRuby.
Squeak by Example