Live data from Hacker News

If Java Is Dying, It Sure Looks Awfully Healthy

drdobbs.com

311–320 of 327 posts

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#311

Earlier quoted context omitted.

Expect it doesn't use an interpreter these days, it is JIT compiled (a la V8). It's quite fast now.

Is it still single-threaded only using one CPU core?

Well almost, you can use web workers and create "tasks" that will use more cpu cores. https://developer.mozilla.org/en-US/docs/Web/Guide/Performan...

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#312

Earlier quoted context omitted.

If you don't want to / can't use C#, there's simply no alternative for bigger projects. People keep repeating this as it was some sort of axiom. My feeling is that people mean that it's hard to write large Java-like projects outside Java. It's not the the problems can't be solved without Java, it's that you "can't" solve them the Java-way without using Java or C#.

What other statically typed language is similarly fast, has massive ecosystem and great tools? (You need static typing to have Java-like tools.)

Scala is a great alternative. The Java interop is great and the tooling is good, certainly good enough. It's statically typed, but much more expressive and productive than Java.

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#314

Earlier quoted context omitted.

> The development experience may not be as great as when using Java Exactly. I'm pretty sure that switching to something like Scala wouldn't improve my productivity.

We've got a parable in our country about a lazy bastard, that couldn't do anything out of laziness to the point of dying from hunger. One day a woman offers to help him, to give him shelter and food. To which the lazy man asks in response ... will you soak my bread? (sounds much better in Romanian) Fuck dude. You're a developer. If you want productivity, make shit happen.

wtf?

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#315
post #225

Earlier quoted context omitted.

> Well, there are programming languages and then there are conventions. I think a programming language is more like an alphabet, and programming conventions are the real languages. I like this. As a thought experiment, consider the idea of transforming a convention into another "letter" in the alphabet. A simple example would be the natural numbers. If our alphabet is "a", then we can represent 1 as "a", 2 as "aa", 3…

>> fold ( ) x it should be fold ( ) 1 x or foldr1 ( ) x or foldl1 ( ) x of course according to Guy Steele, fodl and foldr are considered harmful :)

I don't really understand, can you explain more? I should have written in my comment that I'm a Haskell beginner...

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#316
post #61
post #57

Earlier quoted context omitted.

Languages like Matlab are best suited for expressing calculus. Why are you choosing a poor tool for the job? Most Java programmers don't care about expressing calculus. They care about expressing interactions between web services, sql, and applying rules as the data flows through their modules. Or between user interface elements and service requests. It's all about moving data around, working on that data when you've…

The problems of pushing bits from one server to another aren't that complicated and the pomp and circumstance of java gets in the way of actually accomplishing those things. As you point out when you have a reasonably complicated problem like applying functions java fails miserably and other languages are a much better choice.

Actually, part of the problem is the academic experience of believing that applying functions is hard and pushing bits is simple. It deceives delusional academics like yourself into believing it's just a matter of doing the work and not really a real computation problem at all.

No, in the real world, it's exactly the opposite. Nobody cares about writing a function because generally that's the simple part. Do it however you want. Deploying the system to take inputs and feed outputs, now that's the hard part. Where do those inputs come from? In what form? Are there security requirements to gather or push data? Do you store-and-forward or don't you? What protocol? Stateful or not stateful? Transactional or not transactional? The problems involved in "move these bits in this format on this machine to those bits in that form on that machine over there" are in fact so complex that you can't even prove it to be an NP-complete problem because the problem itself transcends algorithmic analysis. It is much more a social problem than a technical problem, but the social problem is so massive that any simple-minded technical approach will fail to address the scope of the issue and in every case I've ever seen, simply makes the problem worse.

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#318
post #310

Earlier quoted context omitted.

http://learnyousomeerlang.com/

Erlang is awesome, but only offers high-level concurrency constructs (actually, just a couple), it does not support low level ones (CAS). You can't write, say, a good concurrent hash-map in Erlang. Or in Haskell, for that matter.

Unless I'm mistaken, this library provides CAS for haskell: http://hackage.haskell.org/package/bits-atomic

Though if you were only affirming that it isn't a language construct you are correct.

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#319

Earlier quoted context omitted.

What? C++ comes with robust trees & hashes via the STL, along with a pretty extensive library of algorithms that work on all the STL containers. And, unlike Java, C++ lets you pack value objects contiguously in memory, which can be a massive performance win due to better cache behavior/no pointer chasing.

And, unlike Java, C++ lets you pack value objects contiguously in memory, which can be a massive performance win due to better cache behavior/no pointer chasing. Certainly, and it is one of the features that I am often missing in Java. Rather than having an array of structs, you need to make n parallel arrays, where n is the number of struct fields. And sometimes such hacks are necessary to make things compact and fa…

IBM's Java 7 and 8 beta's already have this. It's called Packed Objects and it lets you have have high density data with no pointer chasing along with a much cleaner interface to off-heap languages like C/C++/C# and even languages like Fortran/COBOL etc.

http://www.slideshare.net/mmitran/ibm-java-packed-objects-mm... and http://www.slideshare.net/ZeroTurnaround/ryan-sciampaconerun...

Re: If Java Is Dying, It Sure Looks Awfully Healthy

#320
post #41
post #25

Earlier quoted context omitted.

I'm fairly certain Java and C++ have comparable speeds, and I think in someways Java's faster.

The lack of non-heap objects makes you bend backwards more than you should though.

If by "lack of", you mean "4 choices": DirectByteBuffers (Azul/IBM/OpenJDK/Oracle etc) Packed Objects (IBM) Real-time Java (Azul/IBM) Unsafe (Azul/Oracle/IBM/OpenJDK etc)
Post reply on HN