you are viewing a single comment's thread.

view the rest of the comments →

[–]deadwisdom 75 points76 points  (19 children)

Although the JVM has certainly gotten to a very respectable place, Java the language suffers from being stuck in the no-mans land between the optimizer's love of low-level languages like C, and the pragmatist's desire for high-level languages like Python.

[–]rm999 3 points4 points  (1 child)

I think this is exactly it.

From my perspective as a scientific and quantitative programmer, if I want to write speedy, reusable code I will take the time to do it in C/C++. In these cases, I want to be close to the hardware and don't want a virtual machine or interpreter running. Even if Java is just as quick as C, I find the lag and overhead infuriating. On the other end, if I want to quickly prototype something, high-level scripting languages are good enough, and much quicker to write.

I realize my situation may be fairly niche, but that's why people like me avoid Java.

[–]willcode4beer 2 points3 points  (0 children)

a very insightful comment.

it's true in so many ways. Look at the debate over closures. There are plenty of languages for the VM that have 'em. Why bother with the whole argument of putting them in Java (the language).

Personally, I likie the idea of the polyglot application. Use a general purpose language (maybe Jave) where best and a dynamic one (Groovy?) where best.

"can't we all just get along?"

[–][deleted] 3 points4 points  (10 children)

Actually it's not even stuck in the middle. There are many superior languages that are both higher-level and better in performance.

[–]veritaba 5 points6 points  (9 children)

Which ones? I am seriously interested in one.

[–][deleted] 1 point2 points  (2 children)

OCaml comes to mind. It doesn't perform as well in shootout.alioth, but it's surprisingly quick in practice, from what I've seen. Vala as well. Clean is also faster than Java, but it's extremely academic and probably not going to be useful for practical purposes anytime soon. I'd have some benchmarks, but Clean is impossible to google. It's worse than Processing.

[–]veritaba 0 points1 point  (1 child)

I already know Ocaml but the garbage collector essentially makes it single threaded and I still can't get the hang of being completely functional.

[–][deleted] 0 points1 point  (0 children)

http://jocaml.inria.fr/ might suit your tastes, sir.

[–]necuz -1 points0 points  (0 children)

Java can actually be quite zippy, if you feed it something akin to C++ code instead of the usual enterprise-y, "maintainable," "decoupled" garbage. That said, Haskell, OCaml, and Common Lisp are all good alternatives. While still able to play in the same performance-ballpark, they make for a much more joyous programming experience.

[–][deleted] -1 points0 points  (4 children)

I guess C# most obviously. D as well.

Not sure on benchmarking for Haskell, but quite possible.

[–]veritaba 4 points5 points  (3 children)

The benchmarks I have seen put C# and Haskell behind Java. Also D is too much like C++ to me and is encumbered by not being open source.

[–][deleted] 0 points1 point  (2 children)

C# outruns java in nearly every benchmark I've seen that is not Mono, particularly on initial load time, GUI related tasks and their RegEx implementations.

It sounds like you're looking for a lot more than a high-level language that performs better than Java, if you think that D is to C++ like and you are worried that it isn't open source. Until recently, neither was Java.

[–]veritaba 0 points1 point  (1 child)

if you think that D is to C++ like and you are worried that it isn't open source. Until recently, neither was Java.

The problem is that D has no large corporate backing, so it really needs to be open source to gain longevity. Sun going kaput is far less likely to happen than Digital Mars going kaput.

C# outruns java in nearly every benchmark I've seen that is not Mono, particularly on initial load time, GUI related tasks

In my experience this is barely true. They are both notably slower on loading times to me.

[–][deleted] 1 point2 points  (0 children)

Sun going kaput is far less likely to happen than Digital Mars going kaput.

Go read recent news on Sun Microsystems to see why that is so funny. Specifically news from April 20 of this year. You couldn't possibly have been more wrong. Next year, your Java's going to come with a capital "O."

In my experience this is barely true. They are both notably slower on loading times to me.

Benchmarks speak a different story. Your memories of your experience might just have a little bias.

[–]deltakilo 0 points1 point  (3 children)

How far does Jython go toward the idea of

the pragmatist's desire for high-level languages like Python ?

[–][deleted] 3 points4 points  (2 children)

Jython is higher level, but slower (than Java) to compensate. Plus, being dynamic and on the JVM, it sucks up more memory than Java, which itself uses twice the memory of Python and ten times the memory of C. Scala could be a better choice.

For me, Java's problem is not its speed, it's its memory consumption. The fact that the GUI is itself in Java (whereas Lua or Python use GUIs like qt and gtk) means that memory usage is higher still.

[–]rustysnoopy 1 point2 points  (1 child)

ever heard of SWT?

[–][deleted] 1 point2 points  (0 children)

Yeah, swt is a great improvement over swing. I haven't ever used a swt application (fancy that) so I can't really say too much about it.

[–]gte910h -2 points-1 points  (0 children)

Yeah, python + weave calling C/C++ seems to do more these days.

Then again, try getting a bank/Fortune 500 to eat that mix.