Posts Tagged JVM
Google App Engine: killing many birds with one stone
An interesting fact about the new support for Java in the Google App Engine, is that it supports real, standards based Java; in other words it runs JVM bytecode. It might sound like something trivial, but it’s not. In fact, before the announcement many people had speculated that the Java support in GAE would be based on some sort of variant of Java. Maybe they would use only the Java syntax, but not the compiler.
See GWT: on one hand you’re developing in Java, and you’re lead to believe that you are actually writing a Java application, but when the source gets translated for deployment, it’s JavaScript that is generated. There is no trace of Java whatsoever in the code that runs in your browser. Using Java as a source language is just a way to leverage existing tools and developer skills.
See also Android: here it’s not the source code that gets translated to a target code, it’s the compiled JVM bytecode that gets translated to another kind of bytecode, the Dalvik executable bytecode. And the Dalvik bytecode runs in Dalvik VM, Android’s own virtual machine. Again, no trace of Java at runtime. Again, Java is used because of the existing tools and skills.
But apparently, it goes differently with the GAE. It runs true, standard JVM bytecode. It supports WAR deployment, JDO and JPA mapping, etc. This is already a good thing in itself, but there’s an added benefit to this, which is maybe the reason why Google choose to make it this way: it can run bytecode generated by the emerging galaxy of languages that compile to JVM bytecode or run in a JVM, such as JRuby, Groovy, Jython, Scala, and others.
That’s what you call killing many birds with one stone…
Project Guest VM
I’ve often wondered how realistic it was to imagine a JVM without an OS. There have been attempts to create a full-Java OS (Sun’s own JavaOS, JNode, JOS, JX, …) and I recall that when Java was first introduced, Sun promised that there would be Java CPUs that would natively run bytecode. Results have been quite disappointing so far, even Sun abandonned its own JavaOS project, and attempts to optimize bytecode execution at the CPU level have been limited to mobile platforms.
I discovered today that there is a project at Sun that takes the virtual approach. Instead of trying to create a full-blown Java OS, the Maxwell Project aims at creating a JVM that can run directly as a guest under a hypervisor without the need for a guest OS:
A Virtual Machine Monitor, or hypervisor, e.g. Xen, manages the concurrent execution of several guest virtual machines on a single computer. Guests are typically traditional operating systems but may be any system that conforms to the API exported by the hypervisor. We define a Java Guest to be an implementation of a Java Virtual Machine (JVM) that runs directly on the hypervisor API without the traditional operating system layer.