122 points · by pron · 11y ago · 57 comments
Let alone the IDE support. I think it's truly amazing that I can make a project with 3 different JVM languages and get instant IDE autocompletion and warnings when calling methods between those languages. The source -> .class -> .jar thing has turned out to be a remarkably visionary design (or just a very lucky hit). For comparison, C# still compiles and "tools" that much slower because .class files are missing in the pipeline.
It's a testament to some of the true goodness of Java, despite its unpopularity in hipper circles, that they don't think a Maven-managed folder full of JARs is good enough.
Of course, this is really a JVM thing and you'll also get it if you use a different JVM language so you can actually get the best of both worlds.
All that said, maven repositories and the groupId:artifactId:version:type:classifier organization of modules are really genius. As you say, this genius shines in IDE's where, as just one example, you get nice binary/source .jar distributions automatically downloaded to your local repo. Having an IDE's debugger be able to seamlessly and accurately step through 1st party java sources and 3rd party source .jar sources is always so impressive to me.
Gradle (and Ivy before it) help paper over the pain and expose the good parts of the maven ecosystem. I have some gripes with Gradle, but after seeing it in action (and now that IDE's can grok its project configs) I'm so happy to be ditching maven/plugins and hand-written pom's for the most part.
Java needs a holistic dependency management/dependency injection/artifact repository/publishing workflow rethink where well-defined concepts like semver are enforced in the version numbering scheme, making it easier to express "safe" legal version ranges in transitive dependencies.
I assume that it's a bit better if all your devs (and your servers) are on the exact same OS, but compared to say NodeJS or Java, the Ruby experience is pretty messy. With Node or Java, I just say "these are my dependencies", some package manager downloads them all into a subdirectory, and then I run the app. Done. The only global dependency is the VM itself, which is typically backward compatible so no problem there, just use the latest one. C# has it just as awesome except that some libraries were written by boneheaded Windows-only people (hardcoded backslashes in pathnames, Windows Registry dependencies, stuff like that), so in practice it isn't as cool.
By the time Java 10 gets out, they can see how libraries that make use of modules, reified generics, value types, GPGPU integration, JIT plugins are out of reach.
Worse even, having library devs writing two versions of their libraries.
Google's fork of Java is leading to a Python 2 - 3 scenario.
I have a hard time believing Google will stop supporting Java on Android, especially considering how widely they support it for other various platforms. I do know Go support for Android was recently released though.
Not yet. But it might happen, it depends how value types get implemented.
Check "New Bytecodes, New Objects", "Adventures on the Road to Valhalla":
http://www.oracle.com/technetwork/java/javase/community/jlss...
> I have a hard time believing Google will stop supporting Java on Android
Of course they won't stop supporting it. After all they stated at Google IO 2014, that only Java matters and they could not see why anyone would want to use something else.
But they also don't show any interest to reduce the gap with the official Java.
Even the actual version lacks many of the Java 7 libraries.
> I do know Go support for Android was recently released though.
It doesn't have any official support from the Android team.
> It doesn't have any official support from the Android team.
Go on Android definitely seems to be in its infancy.
In the end, not a solution, but a very nice environment and development choice if you are greenfield and in the target audience.
They have a protoype that does AOT compilation [1] but that's only a prototype and the gains are meager.
[1] https://www.youtube.com/watch?v=d4B8sc7ltZk&list=PLX8CzqL3Ar...
They will switch from the basic jar (zip) format to a more optimized one. Additionally, with a modularized jre, it will load less modules (who use corba?). I'm quite sure there are additional reasons, but it's the 2 that I remember.
I'm surprised by this as well. I was somewhat expecting Java 9 to tackle the dependency version problem.
But, had they included versioning support, they could have also built upon that later to support module distribution to finally not have to worry about maven, ivy, etc.
The main difficulty about versioning though are snapshot (development) versions that don't have a defined version number. In maven, typically these are just "*-SNAPSHOT" which may not be unique enough if two projects wanted to depend on two different snapshots of the same module.
If memory serves me correctly I remember Mark Reinhold saying to do it "right" they would have to run a linear equation solver like Eclipse/P2.
See also: http://wiki.osgi.org/w/images/thumb/e/e2/Classpath.jpg/500px...
JEP 261: Module System http://openjdk.java.net/jeps/261
Java Platform Module System (JSR 376) http://openjdk.java.net/projects/jigsaw/spec/
It will allow a group of jars to be exposed as a single entity, with internal APIs that can be exposed across jars, but not accessible outside the module.
C++ modules are more like packages.
Java modules, which happen to exist in other languages like .NET, Delphi and Ada, are akin to having a set of dynamic libraries exposed as a single library. With the ability of having symbols that are only visible to the dynamic libraries that are part of the same module.
My experience so far is that the list of incompatibilities (http://www.oracle.com/technetwork/java/javase/compatibility-...) between versions makes it nearly impossible to just drop code between versions. It will run, but often implementation details have changed causing significant bugs. Your mileage may vary