One big difference is that Java 8 is using invokedynamic method handles and sacrifices Java 6 backward compatability
Every major Java release sacrificed backward compatibility, so it will be business as usual.
On Mon, Oct 1, 2012 at 6:25 PM, Simon Ochsenreither <simon.och...@gmail.com> wrote:
One big difference is that Java 8 is using invokedynamic method handles and sacrifices Java 6 backward compatabilityEvery major Java release sacrificed backward compatibility, so it will be business as usual.
I don't think this is true, is it?
Am 02.10.2012 10:36, schrieb Fabrizio Giudici:Is there any particular reason a java 8 compiler woudl be unable to emit bytecode (with a -target parameter) that is backwards-compatible? couldn't the compiler just emit anonymous classes instead of invokedynamic?
Definitely. Java is mostly backward compatible and I feel Java 8 will be the first exception.
--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
You 'feel' that it won't be backward compatible? I like reasons, do you have any of those or only feelings?
I don't think this is true, is it?
--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/kM5TMeZm2xwJ.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
I will be disappointed if all these anticipated JVM enhancements offer no measurable or noticeable improvement to Java 8 over current versions of Scala.
The only advantage I see is that the byte code is cleaner and doesn't need as many internal Java class files like what Scala generates. This sounds quite minor by itself.
Personally, I don't care about supporting older Java runtimes, but I expect the Java team to put out something better than what other languages like Scala and Groovy have shipped on the JVM many years ago.
“what's the most minimal thing to do to prevent the feature gap to the CLR from getting even more embarrassing”.
The CLR is hardly ever a consideration in Java directions. The main concerns are much more along the lines of offering as much added value while preserving backward compatibility, two objectives that are, sadly, very strongly at odds with each other.
I think everyone would agree that Java has been very slow to evolve relative to just about everything else.However, Is the CLR ahead of the JVM? Really? Is C# ahead of Java? How so?
The big important features that C# has that Java 7 lacks are already in Java 8: concise, first class functions, functional enhancements to collections, sane date/time api. I suspect Java 8 might even leap frog C# on the latter two items.
C# has other small plusses over Java that I like, but they aren't deal breakers: multi-line string literals, no checked exceptions, value types aka structs, better handling of nullable primitives, declaration side covariance/contravariance of generic classes (where generic types are declared as in/out). Output parameters are also a small plus.
On the flip side, as far as language features and elegance go, Scala really trumps both Java and C# by a large margin.
Also, I like the culture/community of the JVM far more than that of the .NET. The JVM has a more open, academic like culture, where people constantly debate and choose what they feel is the best product language/ide/build tool/test framework/web framework/etc.
On the .NET side, there is more unquestionable loyalty to everything Microsoft.
--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+unsubscribe@googlegroups.com.
It's not an attack: it's the reality check that says that in academia you
discuss about what's the better technology on paper, outside academia you
discuss about what's the better technology in the sense that sells more.
Nothing more, nothing less.
You're not answering, might I know why? :-)
--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/V_q-cLtzTkUJ.
- Better Generics: Java lacks reified generics in that it discards type info at runtime. I agree that this is a deficiency of Java, but the practical consequences of this seem quite obscure.
Sure C# can do List<int> faster than a Java List<Integer>, but int[] goes much faster in both languages, and most super performance sensitive code uses that. Other language features have more tangible benefits.
- Properties: The getter/setter practice of Java is horrendous. C# has first class properties which is better. Scala is even better, in that it eliminates the getter/setter boilerplate and doesn't even need a special property mechanism, you can just use val/var/def.
- Unsigned integers: I know there are some use cases, particularly in hashing and cryptography, where you really want a 32/64-bit unsigned int. Java 8 has library functions to address this which can hypothetically be properly optimized to give full performance benefit. It's still slightly nicer to have native unsigned primitives in C#, but practically Java 8 is fine.
The above three, to me feel like tired language wars points, by people who are already emotionally dead set of liking C# and hating Java,
but in reality, these points don't have large practical implications and are trivial to work around.
- Tail Call Optimization: OK, this is important and Java is behind on this one. Scala has this however.
- Tuples: I looked at the new .NET 4.0 tuples in the standard library, and those aren't any different than any third party tuple library on Java. Scala and others have more native, language level tuples.
"On the Java side, we have bizarro bullshit approaches like JDBC, raw SQL, code generation, JPA, and a ton of other ugly, half-assed non-solutions to problems which shouldn't have existed in the first place."Tons of Java technologies were terrible in hindsight or have been replaced by something much better. The .NET landscape is absolutely no different. In my personal experience, Java devs are more quick to say, the official product is bad, let's use something better, while .NET developers are more likely to stick with and defend the official product.
- LINQ: I've used LINQ when I was doing C#, but I am no expert. Could you articulate what this does better than Java 8? Is it really years ahead?
Most LINQ examples I see on the Internet can be translated into Java 8's functional collections (I'm not sure about join type operations) and the latter syntax is more intuitive/natural. Also, for external database access, typesafe's slick looked like a better solution at a superficial level (I haven't actually had the chance to use it yet).
- F#: I haven't used it, but I've heard great things about F#, and I suspect they are right. This sounds like a more academic, thinking man's programming language and that's not what the typical Joe C# dev wants. I've talked to several C# exclusive shops and interest in F# was very low. Secondly, I couldn't get this running on Mono on my Linux dev system and F# clearly isn't the Mono team's priority. On Microsoft forums, most people said to just use OCaml if you don't want to set up a Windows VM. Ocaml is on my todo list, along with deeper forays into Haskell, but if F# is just a .NET flavor of Ocaml, I can just stick with the latter.
In my observations, even Java developers hate Java :) Or are at best luke warm about it. The last problem in the Java community is over-confidence :) There are several people in this Java forum who constantly talk about how terrible Java is. I don't see anything close to that type of self-loathing over on C# forums and I don't think that's due to product quality.
Because JetBrains have Kotlin, RedHat have Ceylon, there is Scala,
Groovy, JRuby, Jython, Clojure, and yet Java is what the average
programmer writes.
- Better Generics: Java lacks reified generics in that it discards type info at runtime. I agree that this is a deficiency of Java, but the practical consequences of this seem quite obscure. Sure C# can do List<int> faster than a Java List<Integer>, but int[] goes much faster in both languages, and most super performance sensitive code uses that. Other language features have more tangible benefits.
- Unsigned integers: I know there are some use cases, particularly in hashing and cryptography, where you really want a 32/64-bit unsigned int. Java 8 has library functions to address this which can hypothetically be properly optimized to give full performance benefit. It's still slightly nicer to have native unsigned primitives in C#, but practically Java 8 is fine.
- Tail Call Optimization: OK, this is important and Java is behind on this one. Scala has this however.
- Tuples: I looked at the new .NET 4.0 tuples in the standard library, and those aren't any different than any third party tuple library on Java. Scala and others have more native, language level tuples.
- LINQ: I've used LINQ when I was doing C#, but I am no expert. Could you articulate what this does better than Java 8? Is it really years ahead? Most LINQ examples I see on the Internet can be translated into Java 8's functional collections (I'm not sure about join type operations) and the latter syntax is more intuitive/natural. Also, for external database access, typesafe's slick looked like a better solution at a superficial level (I haven't actually had the chance to use it yet).
- F#: I haven't used it, but I've heard great things about F#, and I suspect they are right. This sounds like a more academic, thinking man's programming language and that's not what the typical Joe C# dev wants. I've talked to several C# exclusive shops and interest in F# was very low. Secondly, I couldn't get this running on Mono on my Linux dev system and F# clearly isn't the Mono team's priority. On Microsoft forums, most people said to just use OCaml if you don't want to set up a Windows VM. Ocaml is on my todo list, along with deeper forays into Haskell, but if F# is just a .NET flavor of Ocaml, I can just stick with the latter."Maybe the Java community really needs some "the platform is burning" memo to wake up, stop their self-congratulatory circle-jerk..."In my observations, even Java developers hate Java :) Or are at best luke warm about it. The last problem in the Java community is over-confidence :) There are several people in this Java forum who constantly talk about how terrible Java is. I don't see anything close to that type of self-loathing over on C# forums and I don't think that's due to product quality."Isn't it quite ironic that people claim that Java is the more "academic" ecosystem, when – as soon as some technical points are brought up – someone immediately attacks with the same, sore, old business-pov/popularity/from-authority response?"That's not ironic at all. I use Python a lot because of all the great libraries and the community built up around it. I don't even think Python the language itself is terribly special. It's the same with Java. You have made some technical points against Java, several of which I agree with, but I still like the libraries, community, etc. I don't care about the TIOBE index or that kind of mass market.BTW, I really like Java as a tool for some use cases, but I don't think I'm irrational about it. I use a lot of Python (numpy/scipy type stuff) and JavaScript for web stuff. I'm also trying to invest more learning energy on science/engineering knowledge rather than programming languages. I'd rather understand some new machine learning or data processing papers or engineering skills rather than learn a new programming language feature. However, the latter is more fun and entertaining. It's like a break from the hard stuff.
On Tuesday, October 2, 2012 3:11:19 PM UTC-5, Simon Ochsenreither wrote:I first typed my response to your comments, but it looks that it became more of a rant about the current state of the Java ecosystem. So nothing against you, clay, your response just caused me to vent my deep frustration about the willfull ignorance, the anti-intellectualism, and the denial of reality which has spread through some parts of the Java ecosystem.
--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/NVYbE2hxl30J.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
On Tue, 02 Oct 2012 05:21:06 +0200, Josh Berry <tae...@gmail.com> wrote:
Definitely. Java is mostly backward compatible and I feel Java 8 will be
the first exception.
Are you sure int[] goes "much faster"? Define "much"? I bet the
difference in performance between ArrayList<Integer> and int[] in Java 7
and Java 8 is a lot less than you might suggest based on Java 1.0. No
measurement, no conclusion.
--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/t_L_SXSOfTsJ.
I feel the same sentiment though in reverse. Why are so many people, even in a Java group, pointing out how much faster C# is with integer arrays, when benchmarks indicate the exact opposite?
Ignore anything these benchmarks tell you other than maybe any 10:1 or similar ratios. You're not accounting for JVM warmup and you're biasing the benchmark towards the second item to run in each main by simply running it second. You will get lots of accidental odd results like this.
On Wed, Oct 3, 2012 at 1:08 PM, clay <clayt...@gmail.com> wrote:OK, I couldn't help myself: reran Java test code on JDK7. Wow:Java 8 Primitive test n=1.0e+06 completed in 0.108 secondsJava 8 ArrayList test n=1.0e+06 completed in 1.804 secondsJava 7 Primitive test n=1.0e+06 completed in 0.165 secondsJava 7 ArrayList test n=1.0e+06 completed in 1.908 secondsC#/Mono Primitive test n=1000000 completed in 0.2528684 secondsC#/Mono ArrayList test n=1000000 completed in 1.0193116 secondsScala Array Test and for loops. n=1.0e+06 completed in 0.961 secondsScala Array Test and while loops. n=1.0e+06 completed in 0.130 secondsTwo big surprises for me:Scala Array[Int] + JDK7 actually ran significantly *faster* than Java 7 int[]JDK8 int[] runs much faster than JDK7 int[]. I figured the big optimizations on simple tasks were already realized long ago."Generally, if running Eclipse on top of IKVM on top of the CLR has lower memory consumption AND faster startup time than "the usual way" and this is not even raising the eye brow of the "Java community" I really wonder what can ..."This is absolutely raising my eyebrows. I am surprised to hear that. I would be interested into more specifics of what is causing the difference there.I feel the same sentiment though in reverse. Why are so many people, even in a Java group, pointing out how much faster C# is with integer arrays, when benchmarks indicate the exact opposite?BTW, from memory, Microsoft CLR on Windows which is much faster than the Mono CLR, but Java JDK is faster than both on these types of tests (int[] performance)
--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
IIRC, reification is on the "long term" schedule, for somewhere between versions 10 and 14
Tentatively scheduled for 9 or 10 - I'd prefer to see 9 personally but appreciate its a non trivial change ;-)
On top of this, reification forces you to even some aspect of your type system at the byte code let level.
Imagine if Java already had reified generics, then decided to add declaration-site inheritance in the style of C# or Scala. It wouldn't be possible.
The same goes for any new type system, such as dependent types or the union types proposed for Scala v3. You'd be out of luck! Farewell to potential future innovation...
I think the main driver is to retain the illusion that everything is discoverable at runtime and that bytecode looks like source code in certain ways.
I personally am not bothered either way on this, but I know people often run up against the limitation. In fact, any generic warning or error that a programmer doesn't understand is often misattributed to erasure.
Scala shows that you don't need reification to allow primitives as type parameters, however Scala also goes to lengths with its Manifests to let you get at the original types that I do wish it would present that as reification and not make you have to see any Manifest use in source.
I wouldn't see reification as a disaster for Java if it did arrive, not sure whether Fabrizio is basing this on reason or feelings again.
I think you mean variance, not inheritance. And didn't that change happen to C# between 2 and 3 or 3 and 4, the addition of in and out in type parameter declarations?
If it happened for C#, and C# uses reified types, then reification in Java shouldn't be a reason the same type system change would be impossible for Java.
def method[T : Manifest](xs: List[T]) = xs match {case List[String] => doSomethingcase List[Int] => doSomethingElsecase _ => sys.error("Unexpected type: " + manifest[T].erasure)}
I think you mean variance, not inheritance. And didn't that change happen to C# between 2 and 3 or 3 and 4, the addition of in and out in type parameter declarations?
If it happened for C#, and C# uses reified types, then reification in Java shouldn't be a reason the same type system change would be impossible for Java.
I will be disappointed if all these anticipated JVM enhancements offer no measurable or noticeable improvement to Java 8 over current versions of Scala.Well, I think there are chances for some minor optimizations due to not having to carry around all the class baggage and its semantics.The only advantage I see is that the byte code is cleaner and doesn't need as many internal Java class files like what Scala generates. This sounds quite minor by itself.Yes, that's pretty much it.Personally, I don't care about supporting older Java runtimes, but I expect the Java team to put out something better than what other languages like Scala and Groovy have shipped on the JVM many years ago.That's not planned. For the last decade, the JVM changes have been more along the line of “what's the most minimal thing to do to prevent the feature gap to the CLR from getting even more embarrassing”.
The easiest measure that shows Java is advanced, is the shear inbalance of NET projects that are ports of Java libraries. It seems a lot of people appreciate and value these commodities and thats why they port them. There is very little in comparison going the other way. All numbers are relative, but cannot be disputed that many of the cool libraries on NET came from Java. Java itself has also copied ideas, ports etc from other places, but IMHO its obvious who is in front of whom
Again, I'd like to have some proof of this, because Java is declining, but
C# seems to. If we don't build these assertions upon something that can be
proved, and it's beyond the personal anecdotal experience (for which I
surely presume bona-fide, but it's still anecdotal), we can say everything
and its opposite.
Let's first reset the discussion and have a check on a piece of
information of mine that I'm probably getting wrong. I'm still assuming
Java 8 will do generics reification. Is this right?
Let's define my concept of backward-compatible in this scenario. I'm a
corporate, I have a large codebase in Java 6 (for instance). My upgrade to
JAva 7 will be incremental and made by a path such as:
1. I move to JDK 7 with --source --target 6 and check whether it runs on
JDK 6. Eventually I fix things so this happens.
2. Then I check whether the thing runs on JDK 7. Eventually I fix things
so this happens. At this point I'm mostly happy, since the biggest trouble
with Java 6 is when it goes EOL. Now I'm on a runtime that is still
getting patches.
3. I now move to --source --target 7. Eventually I fix things so this
happens.
4. At this point, I can incrementally start using features of Java 7.
"Fix things so this happens" admits that I have some work to do, if this
work is very well confined I still call it (practical) backward
compatibility of a new JDK. Perhaps I'm using the wrong term?