4 ms·
It's important to differentiate "Java" from the "JVM". Java is a programming language that gets compiled to bytecodes, and the JVM is an execution environment
by aaroniba 19y ago
It's important to differentiate "Java" from the "JVM". Java is a programming language that gets compiled to bytecodes, and the JVM is an execution environment that runs bytecodes. (There is some java-language-ish stuff in the bytecode spec, but for the most part you can treat them separately).
In my opinion, Java is a clumsy language but the JVM is awesome. Static typing and lack of first-class functions or easy data types make Java programs verbose and annoying to change. The JVM, on the other hand, is fast, portable, well-specified, and there are a ton of libraries that run on it.
To have the best of both worlds, you can use the JVM to run a more dynamic language (not Java)! There are many projects to bring different languages to the JVM, but my favorite is Rhino, which compiles JavaScript to bytecodes. Rhino is also what powers my favorite web framework, Helma.
- eduardorochabr 19y agoIMHO, the language is the stronger point in all of these. I don't care if the JVM is well specified, this brings me nothing to my daily productivity. What is the advantage of using Rhino on JVM against using native Ruby or Python? In Java, at least I know I will be very confortable doing automatic refactorings with Eclipse, which is the biggest advantage of Java against these other languages. Having coded a tool in Ruby with some good testing coverage, I still don't feel as safe to refactor as I was using Java.
- aaroniba 19y agoThe JVM being well-specified is what allows other languages (like JavaScript) to be compiled to run on it. It also makes it easier to extend. Rhino on JVM has the advantages of having access to any java library you want (sun distributes many standard ones, and there are tons of other open-source ones on the internet). Another advantage is that the JVM does hotspot optimization which leads to speed improvements. Most other interpreted languages, such as Ruby or Python, are not as far along with their runtimes. As for Java vs. scripting languages, that's a matter of taste. In my experience the way to minimize bugs is to write less code, and I explained above why Java programs tend to be verbose, so I believe the benefits of terseness in scripting languages outweigh the benefits of static typing in Java.