views:

463

answers:

10
+2  Q: 

Java Replacement

I may be posting a premature question, and maybe I'm just freaking out for no reason, but the way Oracle is handling Java is not very promising. I am a nerd who fell in love with Java from the first sight... and use it all the time in my personal/freelance projects but now I am thinking of a replacement. I am fluent in C#/VB.NET too but I am looking for something more like:

  1. Open Source
  2. Compiled
  3. Cross-Platform
  4. Object Oriented
  5. Large standard library
  6. Extensive documentation
  7. Web development is a major plus

Briefly: A Java Replacement!!

I was thinking about a compromise: Python/Django for web development (or PHP), and Qt for thick client development. Anyone with better thoughts??

+13  A: 

Not so long ago, I decided to explore away from the JVM. I set foot on python, and even though i'm nowhere near the expert/ guru level, I dont regret it. Didn't choose C# (considered it) because I consider it to be more of the same. I alredy know (and like a lot) C++, so python seemed like something new, which is what I was looking for.

It fullfils many of your requirements. Particularly, i'm decided not to learn PHP, so the web frameworks in python came in great.

Not to mention, Python has a large community (also see here), always eager to help and teach, which I consider to be very important.

Just my two cents.

Tom
It is not compiled. But otherwise, it fits all points perfectly. Because of this (and because I'm a Python fan), +1
delnan
@del default distribution compiles to byte code
aaa
@aaa I don't think this counts as compilation. Well, strictly speaking, it does, but most of the time, people say "compilation" and really mean "native compilation".
delnan
Pick Python and don't even thing about PHP! I'm serious. I had to leave PHP because it's just a big pile of mess. +1 to python.
dwich
Well I don't mean Native Compilation... an intermediate form is OK
FearUs
@del sure, just want to clarify. personally, long time I thought python was interpreted :-(
aaa
Plus you have Jython so you can always repent and come back.
Thorbjørn Ravn Andersen
Most Java implementations compile to (JVM) bytecode too - so by the same argument you can't call java compiled either.
Dave Kirby
Yeah, I found Python's features is the closest to Java's features.
jpartogi
+2  A: 

Everything you said points to C#, except for the Open Source point.

To fix that, there's Mono.

klez
yeah have you tried Mono on linux ??+ Mono is not **really** an open-source implementation !! have you seen any other open Source CLR implementation ? NO becose MS is M$.+ Mono is useless without all the **cool** libraries of .NET: WCF, WWF, WPF... etcSorry but it's just my opinion!
FearUs
Agreeing with @FearUs, with mono you get open source, but you lose the large standard library.
Yishai
+3  A: 

Try Scala. It looks extremely elegant and promising. Being object oriented and sharing a lot with java in a very concise manner.

Tushar Tarkas
The OP commented: "I am intersted in leaving the JVM"
Justin Ardini
Doesnt Scala run on the JVM ?
Tom
exactly @Tom, by Java i meant the JVM
FearUs
@Tom: yes it does.
Tushar Tarkas
There is also a CLR version of scala (though I don't know how up-to-date or stable it is).
Mike
My understanding is that the .Net version of Scala (more or less) only gets worked on when Microsoft pays someone to do it.
Tom Hawtin - tackline
+5  A: 

Might be worth loking at the other JVM languages - Clojure and Scala are the two I personally think are most promising.

Yes you are on the JVM, but you're pretty independent from Java the langauage and don't have to use any Sun/Oracle implementations if you don't want to.

Having said that - I think that you are worrying a little too much about Java, too many players (including Oracle!) have too much invested to let it go too far off course.

mikera
When I said Java I meant eh JVM ... so thanks for your thoughts, but no :)
FearUs
+1  A: 

I too would like another Java-like technology to come along. Lately I've been doing Flex/Actionscript. While I really enjoy it, Actionscript technology seriously lacks the elegance that Java has. Adobe can write some good cross platform APIs, but they just don't have the head capital to build elegant languages and compilers. I've also tried Ruby, but the VM for Ruby is really bad. I've gone back to Java after my flirtation with other technologies and I think it's because the language is good enough, but the JVM is by far the best out there.

So do you want to stay with the JVM or do you really want to the leave the JVM altogether? Staying on the JVM there are lots of options: JRuby, Scala, Groovy, Javascript, Clojure are the big players. However, there are tons of great languages that can take advantage of the JVM's features.

Leaving the JVM there are still good options like python, ruby, and erlang. But you give up some of the nice features of the JVM like performance (big one), and the ability to drop down to a nice language like Java if you need speed. Those others mean using C or nothing at all.

I finally stopped worrying about Java's future. Sun did all it could to screw it up and it still turned out pretty darn good. I think Opensource has a lot more influence over Java's success than Oracle or Sun could ever have had.

chubbard
+1  A: 

I can't post comments yet, so I'm posting an answer related to the Python discussion. Though Python isn't compiled to machine code, there is a Python-to-C compiler called Cython, which can compile nearly all valid Python -- closures are finally (!) in the latest development release. It's have a big impact on some parts of the Python commmunity, e.g., I was at Euroscipy recently, and over half the talks mentioned Cython.

+2  A: 

You could try D. My one-sentence description of why it's an awesome language is that its generic programming/compile-time introspection/template metaprogramming facilities are good enough to give you almost flexibility of a duck-typed language, while its execution speed and static type checking rival or exceed C++ and C#.

I think it meets your requirements quite well.

  • Open source: The frontend to the reference DMD implementation is open source (the back end isn't due to restrictions beyond the author's control). Work is underway to glue the reference frontend to open source backends such as LLVM (LDC) and GCC (GDC). In the case of D1 (the older version of the language) the LLVM port is fairly mature.
  • Compiled: D is meant to be compiled to native machine code, i.e. raw, inscrutable hexadecimal numbers.
  • Cross-platform: The reference DMD compiler supports x86 Windows, Linux, Mac OS X and FreeBSD. GDC and LDC will likely support a lot more CPU architectures.
  • Object oriented: D isn't a "pure" OO language in the Ruby sense of everything being an object, or in the Java sense of not supporting any other paradigm. It does, however, fully support Java-style OO as a subset of the language, along with procedural and functional style programming.
  • Large standard library: D1 has Tango, which qualifies. D2 has Phobos, which is not "large" yet by modern standards but is larger than C or C++'s standard lib. However, recently there has been a large interest in contributing and Andrei Alexandrescu (its main designer) has accepted several new contributors, including myself.
  • Extensive documentation: The standard library and language are reasonably well documented at the Digital Mars website. There's also Andrei Alexandrescu's book "The D Programming Language".
  • Web development: This is an admitted weakness. D doesn't (yet) have a good web framework, though its native unicode support and excellent generic programming support should make writing one relatively easy.
dsimcha
A: 

I personally don't like PHP, but it does meet all of your requirements. It doesn't officially support compilation but there is the Hip Hop project which compiles PHP to C code. Facebook is currently heading up this project.

That said, I highly discourage you from using it :)

Dave
A: 

C# is the only thing that will meet your needs and not feel hopelessly archaic, or frustrate with limited library. For open source/non-windows, use mono. It's a good, mature implementation of most of what's important in the CLR.

Some things (WPF, WCF, etc) are "missing" from mono, but these aren't so much part of the platform as they are windows-specific proprietary toolkits. Some of them are being implemented slowly in mono, some aren't. Coming from java you won't miss them because you're looking for a platform and good standard libraries to build upon, not a gui toolkit or whiz-bang communication framework.

As far as a platform to build stuff with that's "like" java and offers similar levels of functionality, C# + CLR is the clearest option.

blucz
hmm.. Have you tried Mono? I mean Have you tried it on a real project targeting both Linux and Windows ?? Mono + GTK# ?? Because I did, and eventually it ended up doing a Netbeans RCP application instead (It's Java BTW). But hey, thanks for your response !
FearUs
Yes. I work every day on a large project that targets both MS CLR and mono across three platforms (win, mac, linux) and have been doing so for the past several years. Our app has substantial gui and backend pieces, on all platforms (No Gtk#, however--not willing to take the look+feel hit of gtk). Is it a challenge sometimes? Of course. Is it the best tool available for the job? Abso-fucking-lutely.
blucz
A: 

Using also Cython you get the best of the two worlds , the ability to code in python , the ability to code in C and C++ and of course compile your code and the ability to use both python a c/c++ libraries out of the box. And if you dont like C++ syntax , cython syntax is python syntax and more.

link text

Kilon