7 ms·
Is Java the platform of the future?
- dirkdk 15y agomaybe. The virtual machine makes it possible to develop completely different languages like Scala and compile into Java bytecode. Play does a decent job of rivaling Ruby on Rails in productivity, but it is still Java no Ruby. JRuby? ah, and as java on the desktop has been dead for a couple of years, I think security holes are a minor issue. We've got firewalls for that!
- lukeholder 15y agodoes the author maybe mean JVM is the future? good video on the subject: http://www.confreaks.com/videos/684-rubyconf2011-jruby-polyglot-heaven http://www.confreaks.com/videos/684-rubyconf2011-jruby-polyg...
- tomp 15y agoNo. It has a flawed concurrency model. Heap objects have too much overhead. Poor support for functional programming. Not open source. Except for a major redesign of the JVM (is that still Java?), it's a dying/stagnating platform.
- devs1010 15y agoThe JVM is written in C, if thats what you mean by "is that still Java". I agree Java has its weak spots but I still feel it has its places (maybe I'm a bit biased as I do a lot of Java dev), the whole JSP, Java full web stack is pretty awful, I definitely agree with critics who say things along these lines, but for writing code that isn't just CRUD and actually does computations, uses complex data structures, etc I don't think any dynamic language would be replacing this anytime soon. (are people really writing large scale search engines in Ruby or Python, etc?) I prefer Java to C# as I develop on Linux and have never been into the whole Microsoft scene, so I think its a good alternative to the .Net world. I think the future of Java on the web is mainly for powering API's, whether internal or public, while other languages continue to take over anything relating to the front-end. With java, you have tons of libraries for doing complex computing, the ones that come to mind first for me are search oriented ones like Apache Lucene / Solr as well as NLP libs, etc... Java no longer needs to try to be the "end all" solution, but are there other platforms that have the wealth of libraries for working with big data? (honestly am a bit curious about this)
- tomp 15y ago> The JVM is written in C, if thats what you mean by "is that still Java". No, I mean that if you completely redesign the JVM, you might as well invent a new language/VM without all the crap that comes from backwards compatibility (e.g. type erasure for generics, value types, ...). I agree that dynamic languages won't replace Java, and C/C++ can't compete for business applications either, but I'm betting on a new language that combines the benefits of static&dynamic, object&functional programming. C# would be a powerful contender, if it were truly cross-platform. Legacy code is a big "problem", however, all these projects already have language/platform neutral API (e.g. Thrift interfaces), so integrating them into new environments will be much easier than it was in the past.
- soc88 15y ago> ... I'm betting on a new language that combines the benefits of static&dynamic, object&functional programming Like Scala? Already 8 years old.
- devs1010 15y agoI think this will happen eventually as well, however it still feels far off, I definitely get frustrated with Java's lack of functional programming, I just think its so well rooted now in so many organizations it will be a while until a new platform can really take over.. I haven't really looked at Scala but plan to, the problem is, there just aren't many companies using it and unless you're starting your own, it feels like you have to keep your experience in line with what companies are using
- pagekalisedown 15y agoYou don't think they can fix all that between now and 2021? http://news.ycombinator.com/item?id=3775400 http://news.ycombinator.com/item?id=3775400
- brownbat 15y agoAgreed. Also, Java (or just the JRE?) is a security nightmare.
- brownbat 15y ago1) http://krebsonsecurity.com/2010/10/microsoft-a-tidal-wave-of-java-exploitation/ http://krebsonsecurity.com/2010/10/microsoft-a-tidal-wave-of... 2) http://news.cnet.com/8301-13579_3-57410476-37/apples-security-code-of-silence-a-big-problem/ http://news.cnet.com/8301-13579_3-57410476-37/apples-securit... 3) http://krebsonsecurity.com/2012/03/new-java-attack-rolled-into-exploit-packs/ http://krebsonsecurity.com/2012/03/new-java-attack-rolled-in... Oracle has been irresponsible if not reckless on the security front; between them and Adobe, you have the source for most of the malware attacks out there. If a company sold locks to everyone in America, and failed to notice that their locks accepted any key, I'd like to think they'd be held accountable in some way for the ensuing wave of burglaries. I know, security isn't trivial. But if you're deploying software this widely, you have a duty to the public to hire yourself a security aware dev team and make half an effort.
- moondowner 15y ago> Poor support for functional programming. Not open source. For the concurrency model and heap I'm not competent enough to debate, but for the other stuff you say I can't agree. For functional programming in Java there are a lot of ways of doing it and tutorials as well, starting from those on DeveloperWorks https://www.ibm.com/developerworks/java/library/j-fp/index.html https://www.ibm.com/developerworks/java/library/j-fp/index.h... and OpenJDK shows that it is OpenSource indeed. For example, JBoss (Red Hat's division) uses OpenJDK. And I don't get the point of redesigning the JVM? What's wrong with it now? Is it's architecture somewhat wrong? Please elaborate..
- tomp 15y ago> > Poor support for functional programming. Let me elaborate. There are no tail calls. The GC is not suited to functional programs (lots of small, short-lived allocations) (though that has been improving recently). No first class functions (you have to make an object with a method instead). I might be wrong, but that's a significant overhead.
- drstrangevibes 15y agothese are scheduled to be addressed in java 8 & 9
- soc88 15y ago> The GC is not suited to functional programs (lots of small, short-lived allocations) WUT? That's _exactly_ the thing the GC is good at, and it's that way not since yesterday. The limiting factor is the speed of allocation (no GC involved), not GC.
- tomp 15y agoThe design of the GC can limit the speed of allocation as well. If your VM has a copying (moving) GC for the young generation, allocating a new object is exactly two very fast machine instructions: add to the current top of young heap, and check for overflow. That's how OCaml does it. I'm not sure how to do it concurrency-safe, though. Maybe using small per-thread heaps that get collected whenever an object is shared between threads, or by statically inferring which objects can be shared and which are thread-local.
- smanek 15y agoI think Java is a pretty bad language, but most of your points are provably wrong. You're either grossly misinformed (some of what you say was true about a decade ago, but hasn't been since around the 1.5 release in ~'04) or purposefully spreading lies. You're factually wrong about the open-source thing: the primary impl of Java is open source (http://hg.openjdk.java.net/jdk7u/jdk7u http://hg.openjdk.java.net/jdk7u/jdk7u). Sure, some impls like Azul might not be - but that's the joy of an Open language with a real spec, anyone can write an impl under any license they choose. The claim that Objects have 'too much' overhead is subjective - but also basically wrong. Generally Objects in Java have 8 bytes of straight book-keeping overhead, plus padding to get the size of the fields to the nearest multiple of 8 bytes. That's expensive relative to C, but cheap compared to almost any other object oriented, GCd language (and can often be avoided via primitives, escape analysis, etc). For reference, CPython (the main Python impl) has ~30 bytes of overhead on an Int between tag bits, book keeping, etc last time I investigated. How do you think the Java concurrency model is flawed? Almost any concurrency model I can think of, from Erlang-style message passing (see: Akka) to the new Fork/Join framework can be implemented in Java since its concurrency primitives are complete. I've even done basic impls of STM on AtomicRefs. Frankly, Java has one of the better defined and fine-grained concurrency models I know of. C++ just got a well-defined memory model in the '11 standard IIRC (vs '04 for the JVM). I'm with you on the functional programming thing - syntax on anonymous inner classes and a lack of type inference make it way too verbose. But it's (largely) fixed via Project Lambda in Java 8. And, in the meantime, there are plenty of great JVM languages (Scala, Clojure, etc) with better support.
- tomp 15y agoHm... I'm not trying to argue with you, you're right that I only have a superficial overview of the Java/JVM/J2EE ecosystem, but I will try to elaborate on the points of my original post, which was rather sparse, I admit. As I read Wikipedia, HotSpot is opensource. I'm not sure if that includes the best JIT compiler (what the JVM is known for) as well, or if that's still closed/proprietary, but I'd be pleasantly surprised if it's open source as well. Still, we have the patents issue, i.e. the current legal battle between Google and Oracle. Releasing the source but suing anyone who uses it is not the way to do open source, IMGO (true, the source was release by Sun, and Oracle is the one who's suing, but still). I believe that a general purpose programming language (suitable for business applications) has to be able to perform as well as C for heavily optimized code. What I mean is that you have to be able to write algorithms that run very fast. You can probably do that with C# (supports unboxed structs) and maybe even Objective-C (supports MemoryPools, and method lookup caching), but not Java (AFAIK). Sure, you can always link to external C libraries, but then you have to face dependency hell and portability issues. The issue that I see with Java's concurrency model is not that it is not powerful enough, but that it is too powerful. It allows synchronization on any heap-allocated object, which probably has a lot of overhead (used to be performance overhead, but HotSpot was heavily optimized for that, so after a lot of programmer-hours overhead, the performance overhead was lowered). However, I think that this kind of threading model is not scalable to massively parallel/distributed environments. Synchronization/sharing will have to be limited, e.g. as in Erlang/WebWorkers/Rust, using GCD in Objective-C, using MVar (Haskell) or transactional variables (Clojure). Java probably can never do that, without sacrificing backwards compatibility. Lack of support for functional programming was meant more on the JVM level. There are no tail calls, no fast object allocation, no true polymorphism, and I'm guessing that since closures have to be represented as objects, they are not particularly cheap.
- Radzell 15y agoJava is still the most used language in the world http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html http://www.tiobe.com/index.php/content/paperinfo/tpci/index..... It used on the web, mobile, and desktop. Java problem can be fix and have made strides to modernize like the play framework which modernizes a lot of the things in Java to make it work more like typical web frameworks. Not to mention android which is done in Java which is the most widely used mobile platform. How can a language thats being used more than ever be dying to languages who can crack the top ten most used programming languages.
- bromagosa 15y agoWhile I agree Java is used everywhere, I think the reasons are very similar to why VHS was much more popular than BETA, or why COBOL still represents a _HUGE_ share in programming language usage. Javascript is also used in the web, mobile and desktop. I see the latter much better suited for the future.
- Radzell 15y agoJavascript from my experience is just a bad language. I know that just like objective-c and java aren't going away on desktop or mobile because the underpin a lot of the tech that runs those platforms despite javascript may be running on top. Html 5 needs to fully conquer the web anyway before taking mobile and desktop on which won't be one for a while.
- deleted 15y ago[deleted]
- AlexFromBelgium 15y agoI can't seem to find it, but I read an article about a compiler that brings another language to the python virtual machine!! "Is Python the platform of the future?" EDIT: here's a language running on rubinius (a ruby VM) http://rubini.us/2011/02/23/introduction-to-fancy/ http://rubini.us/2011/02/23/introduction-to-fancy/
- robwgibbons 15y agoSure hope not.
- darklajid 15y agoI believe that the JVM might be 'the future'. Java the language gets too much bad press in our community, but isn't really bad. Just slow to change to suit our trends of the month/year by now. That said and rather meta: That blog had the most mobile friendly layout I encountered so far.
- soc88 15y ago> but isn't really bad I keep hearing this from PHP people, too. :-) Yes, it is not as bad as PHP, but probably just 15 years behind modern language design.
- lancelotj 15y agoDon't forget Java has a bunch of patents associated, and you will get sued by Oracle if you implement JRE yourself like google.