11

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.

Seki
  • 11,135
  • 7
  • 46
  • 70
Mnementh
  • 50,487
  • 48
  • 148
  • 202
  • IBM has their own JVM, but I don't know if it satisfies your first two points (though I think it satisfies the last two). – FrustratedWithFormsDesigner Aug 30 '10 at 13:37
  • 3
    It's become clear to me that you can't write *any* non-trivial program (and certainly not a VM) without violating hundreds of patents. – Ken Aug 30 '10 at 13:39
  • @FrustratedWithFormsDesigner, so does Microsoft, they have their own JVM. – Buhake Sindi Aug 30 '10 at 13:41
  • Perhaps it is a good thing that Oracle is suing Google, they made their own VM which kills binary compatibility, yet they have a translator that can convert Java binaries to their register machine, why didn't they just do that internally? Sounds like they just added a bunch of minor optimizations causing more trouble than good. Google should have made their **own new** VM, library, and language to kill Java, instead of making some crippled legacy burdened clone and killing it anyways... leaving everyone with nothing. – L̲̳o̲̳̳n̲̳̳g̲̳̳p̲̳o̲̳̳k̲̳̳e̲̳̳ Aug 30 '10 at 13:42
  • 1
    "It becomes clear, that you cannot implement a Java VM without license from Oracle" I have to strongly disagree with this interpretation. Even if Google *were* infringing, that doesn't mean it's not possible to make a legal independent Java VM. "I don't want to discuss the impact or the legitimation of this lawsuit" It sounds like that's exactly what you're doing. You shouldn't be assuming already that Oracle's claims have any validity. We're still before the first ruling, let alone the last of the appeals. Finally, you should note that Oracle can't revoke the GPL license on OpenJDK. – Matthew Flaschen Aug 30 '10 at 13:43
  • @Matthew Flaschen: You may be right, that possibly the patents may not hold in court. But that doesn't change the fact, that Oracle is willing to use patents against implementations of VMs. – Mnementh Aug 30 '10 at 13:58
  • 1
    @Mnementh: I thought (hoped) it's because Google is a competitor in this case and breaking compatibility. I doubt they'd sue anyone for making their own compliant VM/library (Apache Harmony, GNU Classpath...), it would just harm the entire Java community. Remember Sun sued Microsoft for the same reason, which _was_ a good thing, otherwise Microsoft would have made their own perverted implementation and supporting it would be like trying to make a site that works with Internet Explorer. – L̲̳o̲̳̳n̲̳̳g̲̳̳p̲̳o̲̳̳k̲̳̳e̲̳̳ Aug 30 '10 at 14:21
  • 1
    @Longpoke: As you said, Oracle will probably not sue compatible Java implementations, but doesn't that kind of defeat the purpose of open source, if you can't, for example, significantly modify GNU Classpath without worrying about legal issues? – Zifre Aug 30 '10 at 14:50

3 Answers3

6

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.

Zifre
  • 26,504
  • 11
  • 85
  • 105
  • 1
    "It is probably different enough to avoid most well known patents" And what about the thousands of not well-known patents? "the whole patent system is absurd" I'm not sure I agree - I think patents are sometimes useful - if you invent a cure for cancer you should be allowed to patent it. But patents should not be given out for trivial things like double-clicking. The patent system needs to be there, but it is badly in need of reform and more strict checks on actual innovation. – Mark Byers Aug 30 '10 at 14:32
  • 1
    @Mark Byers: About HLVM, I meant that most patents on Java and similar VM technology (e.g. CLI) would probably not apply. Of course, that doesn't mean it's completely safe, but nothing is. As for the patent system, software patents are the most obviously absurd part, but I do question the usefulness of the rest of the system too - there is really no evidence that it has done any good. And if someone invented a cure for cancer, it would be nice if it weren't patented, because it would be cheaper. The question is, without patents, would that cure have been invented? Nobody knows. – Zifre Aug 30 '10 at 14:47
  • HLVM looks like a great candidate, Parrot like another one. I will check out these alternatives a little bit further. Thanks for your recommendations. :-) – Mnementh Aug 30 '10 at 20:51
4

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.

Mark Byers
  • 811,555
  • 193
  • 1,581
  • 1,452
2

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”

Panagiotis Drakatos
  • 2,851
  • 4
  • 31
  • 43