Live data from Hacker News

What Future Java Might Look Like

blog.codefx.org

41–50 of 105 posts

Re: What Future Java Might Look Like

#41
To me, most of the JVM languages have 2 similar problems with the "defaults": references are optional, rather than mandatory; objects are mutable, rather than immutable.

It's past time for a language that makes it's references mandatory unless you explicitly indicate "optional" / "maybe" or whatever. Slapping "Optional" on stuff when "mandatory" isn't enforced seems to just make things worse.

Similarly, classes/objects, methods, modules, packages should be side-effect free, unless there is a flag for mutation or other side effects.

We don't need Java 1.9, we need 2.0, with "breaking" (fixing) changes :-)

Scala shows some good ideas, but it doesn't go far enough. That, and I kind of liked Groovy, too, as I would like to be able to turn on and off strong/static type checking. (default on, but if you ask nicely...)

Re: What Future Java Might Look Like

#42
post #23

I wish they would focus on making the underlying platform and bytecode more amenable to all the other, non-Java languages like Scala that compile to JVM bytecode. The real value is in the highly optimized, stable, and performant underlying JVM platform. If it was easier to create languages like Scala that were "compatible" with Java codebases and had the primitives they require in the underlying platform, then that w…

Have you looked at Truffle & Graal, which are going to be introduced in Java 9 to some extent?

https://medium.com/@octskyward/graal-truffle-134d8f28fb69#.h... https://en.wikipedia.org/wiki/Graal_(compiler)

Re: What Future Java Might Look Like

#43

Earlier quoted context omitted.

It is because you do not comment according to the guidelines, which encourage people to start conversation with reasoning etc. Points done bad in your comments: Avoid gratuitous negativity. When disagreeing, please reply to the argument instead of calling names. E.g. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3." Please avoid introducing classic flamewar topics unless you have something…

> It is because you do not comment according to the guidelines, which encourage people to start conversation with reasoning Not strictly. The guidelines encourage people to start conversation with reasoning, but also encourage people to downvote for disagreeing. So, there's some dissonance in there as it says, effectively: "make well-reasoned arguments with which everyone can agree."

We are going OT here, but one last comment in this thread to clarify what I meant.

Putting a comment saying just "Just another vile article", without any thoughts about why it is vile, is just completely against the guidelines (from the points mentioned in my previous comment). Even if you agree with its content or not.

Also, I do not believe the guidelines encourage people to down-vote for disagreeing (or at-least from my understanding). It is just in our nature and the consequence of the fact, that there is a down-vote button. (I have never tried it, still under 500 karma.. :) )

Re: What Future Java Might Look Like

#44
post #12

Languages cannot get better, only bigger, without dropping backwards compatibility. This is why Java needs to die. Not because it's particularly horrible, but because we can do better now.

Yes let's just throw away 20 years of VM research and optimizations.

Dropping some backwards compatibility which impacts performance the most is sensible and I wish java would do some of that but this is a long way from killing java.

Java runs the world, you will have to work very hard and long to produce the same Ecosystem around something else.

Re: What Future Java Might Look Like

#45
post #8

So... scala with some boilerplate?

Exactly. That's the primary reason I use Scala these days - all that's good in Java (libraries, JVM) but with a much nicer surface language! The only thing that's missing, really, is fast for loops (either Java-like, or automatic optimisation when looping over things like arrays or ranges). Conversely, a major thing missing in the post above is some sort of implicits, or at least C#-like extension methods.

Is the excessive virtual dispatch still really slowing down simple for loops in Scala? I thought Paul Phillips did a special-case fix for that. That's very disappointing if that's still a problem.

When I programmed in Scala, I felt like this sort of thing showed that priorities weren't quite right in the leadership somehow. For-loops are pretty basic and their performance is important - simple ones shouldn't have ever been slower than the equivalent Java ones IMO.

Another instance of misplaced priorities (again IMO), was the problem that you couldn't have local/temporary variables in your class constructors (see for example http://www.scala-lang.org/old/node/1198.html). Any values that you created inline in your class body (which is your primary constructor) could be used but would implicitly become fields in your class instances even if they were never used in any methods. Sure you can make factory methods in a companion object etc but should have to do that always? That's worse than Java and for no good reason! The "simplified" syntax of not having an explicit block representing scope for the actual constructor code, separate from member declarations, really bites in this case.

An example of this was the gcd value in Oderski's rational number class which is one of the first examples in his book. The gcd value is needed to initialize the numerator and denominator values, and you want to save it after it's first computed temporarily so you don't have to compute it twice. But naming it at all made it an actual instance field, not just a temporary in the constructor. So every Rational would be carrying around this significant extra storage unbeknownst even to a programmer who would have reviewed the source code, unless they are in the habit of examining javap output for everything or already knew to watch for this issue.

I don't know if that's been fixed or not. The very fact that this could stand for so long, and how implicit the whole thing was about something so fundamental (object construction!), really bothered me about Scala though.

Re: What Future Java Might Look Like

#46
What I would personally like (and I'm kind of surprised all projects which tried to implement it died) is a Java -> static exe/elf compiler (sort of like Go) or at least java -> exe/elf +libjava.so .

I hate that deploying Java requires that everything has to be configured _exactly_ right, and write once run anywhere turns into write once debug everywhere.

Re: What Future Java Might Look Like

#47

Earlier quoted context omitted.

Isn't this upvote-downvote thing somehow linked to confirmation bias? I'm getting downvoted for having issued an opinion which opposes that of the others? This sounds so horribly wrong to me...

It is because you do not comment according to the guidelines, which encourage people to start conversation with reasoning etc. Points done bad in your comments: Avoid gratuitous negativity. When disagreeing, please reply to the argument instead of calling names. E.g. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3." Please avoid introducing classic flamewar topics unless you have something…

Sounds great, really, but it didn't work once when I tried to put up well-reasoned arguments. Why would I follow guidelines any further when everyone seems to interpret them as they well damn please? So, basically 'upvote' is for the popular opinion, and it doesn't matter if it's well reasoned or not. And the 'downvote' is for preventing flame wars by suppressing the unpopular opinion, no matter if well reasoned or not? I'm very confused.

Re: What Future Java Might Look Like

#48
I really started hating Java when I had to write a government office's Licence Management web application using Java.

The tooling is brain dead, except JetBrains IntelliJ. The dependency management system is braindead too (if not for IntelliJ's maven integration). The MVC architecture implementation using Struts and Spring annotations reminds me of PHP. The resulting applications are painful to step through, I don't know why since Visual Studio can easily step through .aspx or .cshtml files.

I then picked up ASP.NET MVC and haven't look back but unfortunately most of the jobs in my country (India) still use Java for legacy web applications.

Re: What Future Java Might Look Like

#49
post #16
post #12

Languages cannot get better, only bigger, without dropping backwards compatibility. This is why Java needs to die. Not because it's particularly horrible, but because we can do better now.

By that standard every language needs to die. Or to put it another way, how long should languages be permitted to survive as we figure out better ways of doing things?

Some languages have official versions than you need to declare right at the start. As in specification version, not implementation versions.

Re: What Future Java Might Look Like

#50
post #12

Languages cannot get better, only bigger, without dropping backwards compatibility. This is why Java needs to die. Not because it's particularly horrible, but because we can do better now.

Yes let's just throw away 20 years of VM research and optimizations. Dropping some backwards compatibility which impacts performance the most is sensible and I wish java would do some of that but this is a long way from killing java. Java runs the world, you will have to work very hard and long to produce the same Ecosystem around something else.

Who said anything about dropping the VM or infrastructure? JVM is awesome. Java isn't.
Post reply on HN