Java 9 with GPU processing, Java 10 will be all-OOP without primitives
javaworld.com
javaworld.com
"A plan is useless, but planning is essential" [1]
More true than ever, if you ask me. Sure, you make plans, why wouldn't you? But you also retain the flexibility to adapt the plan as the environment changes. You don't chisel the damn plan into a stack of stone tablets and render it immutable for all time.
I don't see any conflict whatsoever in planning out through 2021. I would say that in doing so, there's an implicit assumption that the plan - especially the farther reaches of it - are subject to change and are based on current best guesses.
[1]: paraphrase of a quote attributed to Dwight Eisenhower, which was probably in turn a paraphrase of another quote. http://en.wikiquote.org/wiki/Dwight_D._Eisenhower
What happened at back-end, like server-side functionality of business apps? They didn't really change and probably won't change for a longer period of time. Even stuff like Hadoop for big data or Groovy for DSLs were built upon the existing JVM.
It's hard to say what devices we'll have in 5 years, or what internet would look like, but i'm pretty sure servers would run good old Java.
I think the point is more that 5+ year planning in the tech industry is simply pointless, not that all technologies will be replaced. Sure, there are some constants. We can all safely predict that in five years we'll still be writing drivers and middleware in C, still be using zlib and libjpeg, etc...
On the other hand, predicting what changes will occur to a legacy enterprise system tend to be much easier.
In the overall scope of things, Java hasn't really changed that much over the past five years. I think that some long-range planning of the kinds of changes they are thinking about actually makes sense. The need for closures, reified generic types, and an improved type system is unlikely to change in the next 5-10 years.
Hadoop become popular for handling big data, but I'm not sure if many are using Groovy for DSL's. The 2 big uses for Groovy in industry seem to be (1) scripting on Grails, and (2) quick standalone scripts for testing or booting Java code. For these it rocks but the stuff added after Groovy 1.0, such as DSL's, isn't really being used much.
Blackberry remains much more relevant than windows phone. You also forgot to mention Bada which also has more share than wp and is growing. I'm not trying to beat up on wp but as it stands reality conflicts significantly with marketing.
Edit: why the down mod? if I'm in error, please point out where.
That would be way faster and they learned so much by now to make a great successor. Who wants a Java 1.x in 2040?
Sometimes full rewrites are necessary and good. The trick is doing it correctly. Rewrites are riskier, more difficult, and require more development resources than greenfield development. More so when you consider that you can't just abandon the old code until the new code is mature and has proven itself.
Most people do rewrites the wrong way, and they get into trouble, but that doesn't mean there isn't a right way. There are many examples of unsuccessful rewrites in history, but also many examples of highly successful ones.
On the contrary, there has been a number of times that I've completely rewritten some code to use a framework or library that was already battle-tested and more fully-featured than the previous effort. I ended up saving myself from writing code that already exists.
At this point oracle can't rewrite Java. If they don't support the current programs, nobody would use it, if they do, they will really be rewriting code that already exists.
The history of the WebKit codebase stretches back as far as Gecko. The earliest KDE HTML work I can definitively establish is in 1997. We got Konquerer in 2000, but Safari didn't emerge until 2003.
5-7 years before something other than IE could again be competitive... Do you really think that disproves Joel's point? I think it may be quite the opposite...
Also, IMO there's no chance of Perl 6 being successful in time (which makes me sad, because 10 years ago or so I was really hopeful about it).
I still have quite a bit of hope for Perl 6. I use Perl 5 as my goto short scripting language. I really want it to work.
Think of it like pg called a hundred year lisp language. Perl 6 might be the age proof Perl language. When you have such and ambitious goal the time taken is worth to fulfill it. Larry wall figured out quite a while back evolving Perl 5 may fix some warts but it won't solve the larger problem.
The larger problem today is doing language extensibility sane-fully. There are no C based languages that are as much extensible as a Lisp based languages. Perl 6's larger aim is to solve that. While retaining the 'Perl factor'.
Re write is inevitable if you have to solve this problem, no matter what joel says you have to rewrite a few things to fix them. The incremental path is too slow and you will loose out on time while somebody eats your lunch.
Perl 5, Python x.0 and Ruby x.0 series are all great languages but eventually on the very long run they will be plagued with the same technical problem every language runs in to. Providing sane ways of extensibility without bloating too much.
IMO Perl 6 will do well, for the same reasons Lisp has done well.
After almost twelve years of rewrite after rewrite after rewrite, it's no wonder people stop caring.
But for others. I can understand the obvious disappointment. But Perl 6 is designed such that without many of those failures we couldn't have figured it out earlier what it would take to build Perl 6. Perl 6 has a mutable grammar, which means it should be written in itself. And this created a huge problem, because you don't have ready tools in hand to build such a thing. Many of them had to be built from scratch. And people failed many times exploring strategies doing that. Some people got ill, some people lost jobs, and projects like this which span a lot of time and require volunteer effort without much funding takes toll on people.
In many ways there was a lead, Lisp is so extensible because its written in itself. We really should have understood this from history. But achieving that in a non homoiconic language was difficult and required thinking in direction totally new to C based languages.
But great things have come out of it. Audrey's Pugs taught us so many things. And as she says, the 'Perl 6 on CPAN' thing started long back. Moose has become a very awesome tool for OO programming. Other things borrowed from Perl 6, things like given/when have shown a way to Perl 5 for evolution. Devel::Declare showed a new way to do syntax experiments outside core without using source filters. And many great things have come out of it. Its difficult to imagine how Perl 5 will likely evolve over time.
A few years back none of us could have seen Devel::Declare or even Moose coming. I can only imagine how Perl 5 is going to evolve over time.
Lastly I would say Rome was not built in a day. Perl 6 will take time, but it will come out in some years to come.
Sure, but those don't account for the past four years of failures. What I see is a pattern of overwhelming desire to throw away code just as it's in danger of becoming useful to actual users.
Phrased from a different angle, the reason we wanted monthly releases was not because monthly releases are interesting in and of themselves, but because they could deliver regular (if incremental) improvements to actual users on a predictable schedule.
Forking Rakudo into an all-but-abandoned master branch and doing monthly releases off of that branch hews to the letter of the idea of monthly releases while violating the spirit of those releases. I understand the reasons why it happened, but that sort of decision has happened often enough in the project that it's a habit--if not culture.
for example: http://www.infoworld.com/search/google?cx=014839440456418836...
I've used Ruby for almost as long, and on MRI at least, I can't think of anything as significant. (JRuby FTW)
Think of c#'s evolution. Ruby's. JavaScript's. SQL's. 9 years isn't exactly blazingly aggressive, but in the context of a programming language it's not eyebrow raising either.
I think generally that's a good thing.
I'm no Oracle fanboi, but I bet without the legal and corporate circus, they will iterate faster.
And business planning is always done like this.
If Java no longer remains useful to Oracle expect the same thing what happened to things like flash.
It will be donated to Apache software foundation.
One thing not touched on in the article but would definitely be worth know is if Oracle will start inserting "pay-to-use" features in the language or release a solid JIT compiler and run time companies must pay for in order to use. I know it's been bandied about in the past that Oracle might start restricting access to some language features and with such a long term roadmap, I'm wondering if they're thinking about making some of these selling point features into business revenue features.
(Fuck boxed primitive types. How about generics that weren't designed by drunk retarded monkeys?)
The problem with Java today is how big and bloated it has become while it doesn't solve fundamental problems programmers face. Its growingly becoming impossible to program in Java without an IDE. Only Java ninjas can probably program Java with a Text editor. Its XML mess all over the place.
Now it takes several tens of lines of code to do trivial file operations and other trivial tasks. This problem was long solved with languages like Perl and Python around 20 years back. Its almost two decades and Java still hasn't caught up. There are still no practical lambdas and good functional programming capabilities.
The issue is something like this. By asking everything to become an API of some sort and writing so many method calls both my unit tests and exception handling code bloats like crazy. My eyes cringe every time I open a Java class file and nearly 60% of the code in there is either try/catch statements or some form get/set methods.
The code to boilerplate ratio is too high. And it just doesn't feel like a language that belongs to the 2010's. Java and its community also promotes heavy use of XML's often used as bad replacements for RDBMS, this leads to building of small buggy and wrongly built DSL equivalents of small parts of SQL all the time.
The path from now is not the make the language bloat like crazy and then provide IDE's to handle that. It is to make the language syntax intelligent enough to take care of many problems you have to other wise worry about. If you see the whole concept of Lisp and other extensible languages like Perl are all about. To provide forms of extensibility that solve the code scalability problem.
And lastly and unfortunately the Java market is full of substandard programmers whose life begins and ends inside eclipse.
A manager or a pointy haired boss might prefer Java for hiring cheap programmers and the 'Oracle factor'. But Java is dead for Start up's and other sexy glorious projects.
I stopped using get/set methods years ago in favor of public instance variables. Yeah, I understand the potential problems with kicking encapsulation to the street and into the gutter (I have written several Java books and I have done many projects in Java, so I am not a noob).
I have also started to favor using unchecked exceptions - that also makes code a lot shorter. This is also Controversial.
Its been a long day, I've been working non stop since 6 am this morning(I stay in India, Bangalore) and its 9 in the night now. I've been working on some Java code.
The AbstractSomethingFactoryFactoryFactoryClasses.java have taken a toll on me. I'm yet to rewind from the depth's of piles and piles of try/catch statements and Object.someMethod() methods buried deep in abyss of com.something.somethingElse.somethingInWonderland.whereTheHellAreWe folders.
But I will take your advice seriously though.
EDIT : After reading your bio and looking at your work on your site. I am your new fan :)
Name calling isn't really helpful. I don't like Java either, but there are a lot of very smart people who worked on it, and many of them labored under constraints I do not envy. That's all.
Their fundamental concern is to milk Java as much and as long as they can to drive their sales for Oracle DB and associated business products. And that makes perfect sense too, they are in business to make money anything else and they won't be doing their job properly. Don't you see what has become of Sun Microsystems? They were making awesome stuff by the day for somebody else's profits. Oracle is not going to make the same mistake again.
Java is oracle's strategic investment in using that as a leverage to drive sales else where. And looking at their segment, its mean't mostly for large corporate programmers and not hacker, start ups and alike.
I bet IBM makes sufficient contribution to COBOL still just to keep their mainframe sales alive and not because they want COBOL to be awesome enough to rule the world.
Similarly Oracle's contributions and investments to Java are going to be for driving their sales not for sake of making Java awesome.
But I downvoted you because this has almost nothing to do with ootachi's comment about the realities that the designers of generics had to cope with. You're just regurgitating the same criticisms that has been leveled against Java for years.
>>What choice did they have?
The only choice Oracle has is to invest in Java in areas that is going to help them sell their products.
That is the only choice Oracle has.
ootachi was was referring to the designers of Java generics, who were working sometime before Java 1.5 was released in 2004, long before Oracle bought Sun.
It shocks me that a major company like Oracle would be so foolish as to make a statement like this. Stating that something is not is one of the most effective ways to imply that it is and the speaker knows it.
Edit: I remember reading this years ago and have been unable to track it down. Would love it if somebody did.
Another way to put it is that psychologically, a statement and its negation are not opposites but rather go together. The same idea comes up in hypnosis, where it is said that the unconscious mind drops the "not" and simply receives the images that are given. For the same reason, it's better to say "Remember" than "Don't forget", which is a kind of subliminal invitation to forget. And so on.
If Oracle's plan is to keep Java alive as a glue for their DB that strategy would work fine.
But it would be a long term disaster in terms of overall innovation, and long term viability for choosing everyday projects.
What about Android apps?
What about solid back-end?
What about Google AppEngine-Java?
People are still using Java for everyday projects and I don't see a disaster coming anytime soon.
Coming to Android and other Google initiative they tend to happen only because the tooling, documentation support and a large pool of programmers that exist.
Java today is not used because its awesome, its used because for a certain section of industry needs massive supply of low price programmers. And with Java the people, the tooling support and rest is already there.
Hence no doubt Java is the next COBOL.
The IDE removes that problem somewhat.
It's not that Java coders "can't write a line of code without an IDE", it's Java coders don't have the patience to write pure Java in a text editor.
You're also forgetting that a lot of enterprise applications consist of many many .java source files for each class. Trying to deal with all of that manually becomes a real headache
Intelligent people avoid headaches.
Prevention is better than cure. And IDE is a cure, Avoid what forces you to resort to a cure. Prevent the disease itself.
Thank you for insulting Hadoop, Hbase, Cassandra, GWT commiters and developers at Google, Twitter, LinkedIN, and many more smart people who happened to choose Java.
Nice reply with no factual support.
By the way when given the choice its clear what the founders choose. Larry Page and Sergey Brin chose C++ and Python and Mark Zuckerberg chose Php. Twitter started out on Rails.
So its clear the Java mess seeps in only when the hackers are cleared from the scene and the layers of management begin to take control.
I don't even want to know how you came into these conclusions. They don't make any sense at all.
Java was 3 years old when Google started off. Did you get the link where one of the founders was asking question about Java back in 98 regarding web development? Did you know that Java has been used for many many years inside Google when these so called hackers were still working there?
Did you know that Twitter actually gets more stable when they migrated to Scala and Java? Did you check the presentation by Twitter engineer as to why they moved away? Those are technical presentations, not management business type of presentation. Are you suggesting that rails hackers were the culprit of all Twitter scalability iscsues?
I am unsure if we live in the same world mate.
There's lots of old, conservative, slowly changing companies out there that have craploads of money and need (for certain meanings of the term) Oracle. Having control over Java gives them a lot more leverage in those markets, too.
1. 'Hiring the cheap programmer' factor.
2. 'The Oracle' factor.
3. 'The pointy haired boss' factor.
And those are not awesome reasons to stay alive.I remember Bjarne Stroustrup telling Java isn't platform independent, Java is the platform. Meaning compiled C++ runs on processors directly, but compiled Java runs on JVM. So JVM becomes analogous to a processor.
So comparing JVM based languages is like comparing languages directly compiled to a processor like a ARM processor. Future of JVM is different than future of Java.
Just like future of C++ is different than future of pentium.
public class CompoundObject {
int i;
int j;
double k;
}
This class's data members are all a few bytes away from each other, so once the object is loaded into the CPU cache, all operations should be fast. With boxed types, you might get 3 cache misses when accessing i,j,k.On the other hand, referential transparency can help here. Given referential transparency, the compiler can transparently unbox Integers and translate method calls. So if Oracle does it right, rather than slowing down unboxed code, this might just speed up boxed code.
Even if these things turn out to be impossible to optimize at compile time, they're probably then betting on JIT functionality to detect primitive objects that are only used as primitives.
I do not know whether the standard currently allows for code that is guaranteed to produce Double's with equal values that are not object.Equal to each other, but I doubt that making that impossible will introduce many problems.
May be true, but it's not guaranteed one way or the other. In the Oracle JVM the smaller integers are cached such that
new Integer(10) == new Integer(10)
but new Integer(1000) != new Integer(1000) Integer a;
Integer b;
a = 10;
b = 10;
a == b; // true
a = 1000;
b = 1000;
a == b; // falseI either imagine hardware progressing so far in the next decade that this is absolutely moot or the language changing directions and some surprise coming out of left field to change this gameplan.
For example Dylan language doesn't have primitives as such. The d2c compiler passes objects around as a two-element struct containing a type tag and a value (in practice values get passed around in a pair of registers). Now, if you have a field with the declaration <object>, and you store a <double> in there, then the field will consist of two words: a type tag and the double itself. However, if the field is declared as a <double>, then the field will be stored as just the double, and the field accessor code will add the (constant) type tag as the field is read.
Such a thing could be done in Java if Oracle added structs. They're basically just "unboxed objects". I believe there's more to it than that, but that's the basic idea.
I know the article didn't mention it, I also wonder what the memory bloat will look like when they turn all primitives into Objects and introduce object overhead just to track int i in a for loop.
These slides were posted last November, so they're probably a bit stale, but might give some insights: http://www.slideshare.net/JAX_London/keynote-to-java-se-8-an...
It's mind-blowing that they plan on having GPU and FPGA support before they offer arrays of structs and multidimensional arrays. Frustrating, too. I guess I can't complain, since clearly somebody is paying for all this, and it isn't me.
Not meaning to start a flame, just saying the title's a bit inaccurate IMHO...
So if you have a class:
public class X {
public Int32 i;
public Int32 j;
public Int32 k;
}
Then it takes 12 bytes + single object overhead (which in MS .NET I believe is two pointers).But if you assign a primitive (e.g. Int32) to an variable of type 'object' then it will be boxed and then require the object overhead.
A neat thing about C#/.NET is that generics are baked deeply into the platform, so using primitive (actually, any value-type struct) types as generic arguments will not require object memory or casting overheads.
A parallel can be drawn with C++ in which the user of a class decides on declaration/initialization where to store the object (either on the stack, or on the heap). The difference with C++ is that in C# the author of the class decides where instances of it should be stored, so this decision happens when the class is declared, not when it's used.
Otherwise there are few differences between structs and classes and all differences stem from the differences in storage. For example struct instances must be passed by value and not reference, because by definition stack-allocated values are short-lived and playing with references to stack-allocated values is dangerous. Structs must also have an implicit constructor because stack-allocated values cannot be NULL (logically, you need a reference to represent NULL).
In my experience, all discussions about what is or isn't an object are counter-productive.
What really bugs me about Java is that you cannot build your own types that behave just like the built-in types. For instance you cannot override operators like "+" (which works for primitives or Strings), you cannot override [] (which works for arrays), you cannot declare other stack-allocated structures, arrays are reified and yet you cannot declare your own reified data-structures and so on. The presence of primitives doesn't bother me as much as lacking the means to build my own primitives.
You have it backwards, they're not value types because they're allocated on the stack, structs are allocated on the stack because they're value types.
See Eric Lippert's article "The Stack is an Implementation Detail": http://blogs.msdn.com/b/ericlippert/archive/2009/04/27/the-s...
Also Eric Lippert nails it when he answers the question of why reference types are not stack allocated and value types are ... “because they can”.
I do agree with the article, but with all due respect to Eric Lippert, C#/.NET was meant to be reasonably fast for all kinds of user-land applications and if structs weren't added, then they had to add special cases (primitives) for dealing with integer and floating point arithmetic, just as Java did.
I do agree that structs have semantic value, but the implementation itself allows the available primitives to be described in terms of structs, which is a really elegant and cost-effective solution to a problem that the JVM engineers are trying to solve with complicated tricks like escape analysis. If you remove the performance/efficiency benefit, there isn't a lot of value left in structs - at least nothing that can't be solved by immutable data-structures and/or a better type system.
Nice article btw, thanks.
http://msdn.microsoft.com/en-us/library/system.valuetype(v=V...
>Data types are separated into value types and reference types. Value types are either stack-allocated or allocated inline in a structure. Reference types are heap-allocated. Both reference and value types are derived from the ultimate base class Object.
When they are used for more than 1 method implementations, well ... they shouldn't be inner classes.
They just exist to fill the gap of having no closures. I say this as a long time and affectionate java user but project lambda in JDK8 is long overdue.
Why not? Very often, a class will have some data members which are pretty much meaningless elsewhere. Why should the class used to represent that data be exposed elsewhere?
More syntax sugar for them would be good, adding first class functions IMHO isn't good.
The interface may be bad but I'm not sure what is missing.
The interface is your basic (irreducible) disconnected/unbound procedure invocation API, with all the positive/warts associated. I agree that in principle, we have enough information in the reflection data structure to allow a (specific) JVM implementation to provide a non-standard 'method object' feature. Consensus, possibly? (Good question, really. C. Nutter is one to hit with that one.)
[edit: apparently my sarcasm was too subtle. HOF and typeclasses are both vitally important pieces of Haskell, which are orthogonal to each other. I'm pretty sure both were in Haskell from day 1. Some code for which both are essential:
class Monad m where
(>>=) :: m a -> (a -> m b) -> m b
(>>) :: m a -> m b -> m b
return :: a -> m a
fail :: String -> m a
][] This statement is based purely on my own experience. I find the Haskell documentation a bit unfriendly with its "academic" style. The content is great, but the form makes it a bit hard to assimilate. Monads were especially painful.
Here's a paper introducing them.
What do you mean? From what I've seen, everyone uses typeclasses in Haskell.
interface MouseClickListener {
void mouseClicked(MouseEvent e);
}
one often uses an anonymous class to do so: void init() {
mouse.setClickListener(new MouseClickListener() {
void mouseClicked(MouseEvent e) {
println(e);
}
});
}
the exact effect could be achieved with a reference to a named function (if Java supported them, which presumably it will once "everything is an object"): void init() {
void mouseClick(MouseEvent e) { println(e); }
mouse.setClickListener(mouseClick);
}
given that interfaces are simply syntax for function routing, when you have the ability to reference functions by first-class types (i.e. you have the ability to determine function routing yourself), the set of things that you can only sensibly do with interfaces is a lot smaller.This is how C# delegates work, right? Any Java -> C# programmer want to comment on whether they rely less on interfaces now and what they use them for?
There are plenty of cases where you really need to pass an object to a function and know that the object supports multiple operations, for instance take a look at Map<K,V>: http://docs.oracle.com/javase/6/docs/api/java/util/Map.html
There are 14 methods there, and when I write code that takes a Map object, I really mean it - I'm not just using the interface as a hack because I want a function pointer, I need an object that supports all of those methods, and I'm probably going to be using several of them.
I think both concepts are probably independent of one another.
Interfaces still serve a purpose bundling together related operations with replaceable implementations. They're just a nuisance for single-purpose functions/functors (e.g. - "run").
As for the very vague improvements mentioned (GPU, no primitives), these can be seen in response to clear technology trends. Even the embedded GPUs in x86 are getting pretty powerful, though not every business has them - but by 2015 most will. Java has primitives primarily for performance and memory efficiency. Absolutely crucial at Java's inception, they though remain important today, many applications can get away without them (e.g. ruby apps). By 2017. even more apps will be in that category.
Most of the others are similarly responses to clear trends, such as hypervisor-aware and large data support. However, true generics seems problematic because it would break back-compatibility.
My prediction: if they plan to break back-compatibility they will change their mind.
I still find it hilarious how even Swing shows how crippled the language is without that feature, where adding event listeners is complicated like new EventListener(Event e) { @override onEvent... etc. When just overriding some declared event handler method would be so much clearer.
http://qconlondon.com/dl/qcon-london-2012/slides/SimonRitter...
I hate those articles not mentioning sources.