61 points · by puredanger · 16y ago · 71 comments
The one and only change to the VM that I would like to see is not even planned: structured value types. This single issue is responsible for Java's massive memory usage. Half of that memory is used for completely unnecessary pointers and it will lead to C or C++ grabbing the title of 100 year language.
When you're watching a 3d projected HD video with 5.1 audio on your smartphone, what's using the memory... A few pointers? Or the actual media? And in any event, we'll likely have a few TB of memory even on phones to play with in a few years.
And this was exactly the complaint in the parent post - this is not possible to do with Java. If you have a list of Integers, you have a list of Integers. (please correct me if I'm mistaken here: ) so every integer needs an explicit pointer in the list itself + the overhead of boxing. It's not the pointer to the list that matters - it's the fact, that your list takes ~4 times as much memory (pointer, lock, tag, value) - or maybe more - I don't remember the object implementation details for JVM.
For scenarios where you operate on big tables of data, it matters, because it kills cache performance and uses up many times the amount of memory that you'd normally use.
I once wrote an x86 emulator in java and later an ARM emulator (long story). It ran fast enough :)
You have chosen an example where streaming is possible. But sequential access is not what you want in databases, search engines, many forms of data analysis.
From the point of view of a web application developer, JDK 7 is not very interesting. JDK 7 will contain a few language updates like switch-cases based on strings. No major changes or features that would radically change a web app developer's coding routines. What do you think?
Mostly in JSR 292.
I see a point where I'm running the best of ruby/python/groovy as core parts of a Java deployment environment.
Edit: Not that you can't now, but now this will bring very good reasons to run a hybrid environment combining the best of both systems.
Some people don't have such a good impression of it, e.g. Rich Hickey (Clojure): http://clojure-log.n01se.net/date/2010-06-01.html
method handles are just going to be an entirely new thing hotspot et al
are going to have to be taught to optimize. They are already awesome at
optimizing ordinary class method dispatch
bobo_: invokedynamic is not needed for removing reflection
....
it is just a different way of doing call site caches, which you can already
do today with classes and methods
What JSR 292 does is to simplify the work a compiler architect needs to do, since implementing call-site caches is hard work, not to mention memory management since interpreters like JRuby are generating lots of classes that are entering PermGen ... so stuff like java.dyn.AnonymousClassLoader may provide some relief.But on the other hand, compilers will still need to support Java pre-7, since adoption in the enterprise is really slow (many companies are still on version 1.4)
There is a backport for invokedynamic though, but it remains to be seen if it's any good: http://code.google.com/p/jvm-language-runtime/
Notably missing features with a lot more bang than InvokeDynamic:
tail-call optimization
fixnums
coroutines
All in all, Java 7 is a monumental failure and Oracle is waisting resources on merging JRockit with Sun's JVM, instead of saving it.Say what you want about .NET, but their releases have been coherent with each one adding value. If only Microsoft's management would see this as an opportunity and open up .NET a bit, probably not.
There will be a schism between libraries that move to Java 7 only, and support their own call-cache mechanism, but I doubt any of the established projects would ditch their existing solutions, it would most likely only effect new libraries.
If an enterprise is busy being tied up in Java 1.4, and missing out on the drastic speed and memory improvements in hotspot 1.6 line, then I doubt that adding dynamic languages is a priority. JRuby for example requires 1.6 (from the literature I've seen and personal experience, but they don't explicitly say so on their site)
I also disagree generally about how Oracle is dealing with Java 7, but I am willing to see what the end result is.
Microsoft has been heavily involved in the IronPython/IronRuby and Mono efforts. They do see the power in .Net cross system.
What exactly would you like to open up?
In my opinion, JDK7 wont have enough incentive for corporations to upgrade Remember how long it took for JDK6 to be adopted? So why release a JDK version if the majority of people wont use it? Why not spend a year or more on building new cohesively designed APIs with closures in mind?
http://code.google.com/p/stab-language/ (C# syntax compiled directly to the JVM)
http://boo.codehaus.org/ (Python syntax, normally for .NET, but there is a pure JVM fork in there somewhere)
The barrier to adoption these days is a robust Eclipse IDE--if either of these projects had one, I think they'd see a lot of adoption.
"Deferred to JDK 8 or later"
In the Java world, this is a good way of saying never ...
So I guess I'll be able to use closures the moment I can stop trying to make my web pages work in IE 6: in the yeat 2040
There's nothing worse than something like bar = *[&foo + 88] or whatever it is.
Significantly easier. Think about all those pointers that simply aren't there now.
> which is a more appropriate in this context
This is a value judgement.
The generally nicer semantics (automatic memory management! proper strings!) are also worth a lot.
And of course, using a VM-hosted language to describe things which are on two levels of abstraction lower is a little bit funny.
Because manual memory management is a PITA.
> And of course, using a VM-hosted language to describe things which are on two levels of abstraction lower is a little bit funny.
Why? As long as you're clear that it's a pedagogical tool, it's perfectly fine. And there are incubation OSes (e.g. Singularity) that are almost entirely managed.