Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are alternatives to the Java VM?

As Oracle sues Google over the Dalvik VM it becomes clear, that you cannot implement a Java VM without license from Oracle (EDIT: Matthew Flaschen points out, that the claims of Oracle may not be valid. Anyways we have currently a situation, where Oracle threats VM-implementations.). That may become the death for Open-Source-implementations of Java (like Apache Harmony).

I don't want to discuss the impact or the legitimation of this lawsuit. but as a Java-programmer I want to take a deeper look into the alternatives, to be prepared for every case. As I see the creation of a compiler as a minor problem, my main interest are alternative VM-implementations, that serve a similar purpose as the JVM.

The VM I'm looking for, should meet some conditions:

  • free of patent-issues
  • an Open-Source-implementation exists
  • potential for optimizations/good performance
  • platform independent (the VM can be ported to different platforms without bigger hurdles)

Please add some recommendations for me.

like image 439
Mnementh Avatar asked Aug 30 '10 13:08

Mnementh


People also ask

What is an alternative JVM language?

The languages we'll look at in this first category are Scala, Groovy, Xtend, Ceylon, Kotlin, and Fantom. The second category is existing languages that were ported to the JVM. Many languages, such as Python and Ruby, can interact with Java APIs and are popular for scripting and quick prototyping.

Why is the Java VM necessary?

The role of JVM in Java JVM is specifically responsible for converting bytecode to machine-specific code and is necessary in both JDK and JRE. It is also platform-dependent and performs many functions, including memory management and security.

Is Python a JVM language?

The other notable mentions that come with the question on what are JVM languages include Jython and JRuby. As the names imply, both these languages are considered as implementations of Python and Ruby designed specifically for the JVM. The compatibility of Jython is observed with the 2.


3 Answers

LLVM is a really good optimizing, low level virtual machine. It can support languages like C and C++, and does not have built in support for high level features like garbage collection.

VMKit is an implementation of the Java and CLI virtual machines on top of LLVM. Since it uses Java bytecode, this probably wouldn't help with the patent issues.

HLVM is another interesting high level virtual machine built on top of LLVM. It is probably different enough to avoid most well known patents, but it is mainly targeted at numerical computing and functional programming.

On the dynamically typed side, there is Parrot.

I am actually working on a compiler and VM for a language of my own design, but don't count on it ever being finished. ;-)

Keep in mind that any large piece of software will infringe on numerous patents, the important thing is how well known they are (and how much the patents' owners actively seek out infringers). Of course, the whole patent system is absurd, and we would be much better off getting rid of it.

like image 145
Zifre Avatar answered Oct 07 '22 20:10

Zifre


GraalVM is a research project developed by Oracle Labs and already in production at Twitter. I can't believe my eyes that no one mentions anything about it, it’s so weird. Anyways, GraalVM is a well promising extension of the java virtual machine to support more language and execution modes for running applications like JavaScript, Python, Ruby, R, JVM-based languages, and LLVM-based languages such as C and C++.The GraalVM project includes a new high-performance Java compiler, itself called Graal, which can be used in a just-in-time configuration on the HotSpot VM, or in an ahead-of-time configuration on the SubstrateVM. The main goal of this project is to improve the performance of the java virtual machine base language to match the performance of native languages. Let’s sum up the novel features that this project offers and make a brief explanation according to the docs why you should adopt it.

  • Polyglot: All languages (even LLVM-based) share the same VM and its capabilities. Zero overhead interoperability between programming languages allows you to write polyglot applications and select the best language for your task
  • Native: Native images compiled with GraalVM ahead-of-time improve the startup time and reduce the memory footprint of JVM-based applications.
  • Embeddable: GraalVM can be embedded in both managed and native applications. There are existing integrations into OpenJDK, Node.js, Oracle Database, and MySQL GraalVM removes the isolation between programming languages and enables interoperability in a shared runtime. It can run either standalone or in the context of OpenJDK, Node.js, Oracle Database, or MySQL.
  • Performance: Graal benchmark reports show great performance improvements in almost all of its implementations thanks to the way that GraalVM performs object allocations

If someone don’t get convinced by now that is a good choice and it is a really awesome project you can see this talk by Christian Thalinger on “on why Graal is a good fit for Twitter”

like image 28
Panagiotis Drakatos Avatar answered Oct 07 '22 18:10

Panagiotis Drakatos


I don't think there is any significant piece of software that is free from patent issues.

If you are an independent developer or working for a smaller company you probably won't get hit directly by the problems though. It's unlikely that big companies holding patents will go after lots of small claims - it's an expensive process and causes a lot of resentment. SCO tried something like that and it didn't work out too well for them.

I would concentrate on finding the best tool for the job without worrying too much about the patent issues, otherwise you will never get anything done.

like image 32
Mark Byers Avatar answered Oct 07 '22 19:10

Mark Byers