Thursday, June 14, 2012

LLVM: On Contrary To Judge Alsup's Oracle v Google

Not so low-level, it turned into the cross-compiler for virtual machines. Of those that I heard that worked on LLVM, they became quite evangelical about it as the portable layer. Yes, it did become one, but not as the run-time VM as its originally said purpose. When the GCC team incorporated LLVM as one of its component such that GCC generated object-code from LLVM byte-code, then other source-code compilers, like Mono, had LLVM as an option for low-level compilation to object-code with GCC's optimization, but the standalone JVM did not.

That intermediate level of byte-code is quite different from how Alsup declares the intermediate level in the Java VM. He wrote, “In the Java system, source code is first converted into 'bytecode,' an intermediate form, before it is then converted into binary machine code by the Java virtual machine.” What he described does not concur where he said “before it is then converted,” as the JIT compiler already has its compiled object-code that the byte-code later references. The object-code of the JIT (just-in-time) compiler is what compiles Java source-code to byte-code. VMs have never converted intermediate byte-code into machine code.

VMs, the virtual machines, managed contexts of object code within an instance of the machine state. Without the VM, the object-code has no additional context other than direct reference to the machine state, so we called that machine-code instead of object-code. Object-code that requires managed contexts does not execute on any machine without any virtual machine present in the same instance.

LLVM was that kind of VM except it obviated separation between it and some other higher-level VM. That really never made sense at run-time, as it appeared as overhead in machine-code. What LLVM designers probably wanted is something like the DLR, the dynamic language run-time, yet what they published was another intermediate byte-code layer.

When Mono developers added the option that let the Mono compiler output LLVM byte-code, that let an alternative AOT (ahead-of-time) compilation stage occur; where GCC compiled that byte-code into machine-code. Some wanted that option as “the better” Mono/.NET VM. What we found is it added another level of optimization that the JavaVM can't even do, so it is “more options” than “just better.”

JavaVM and .NET use ECMA standard as reference for byte-code. Alsup never mentioned ECMA in his decision. Maybe he avoided any similarity said between LLVM byte-code, JVM byte-code, and ECMA byte-code, etc because of said patent issues. He asserted limits on the issues to the copyright by said definition of computer programs, “A 'computer program' is a set of statements or instructions to be used directly or indirectly in a computer in order to bring about a certain result.”

The source-code interpreter used such instructions indirectly. Most popular VM run-times used such level of indirection between source-code and machine-code. That source-code interpretation is slower than VMs that used byte-code interpreters. The VMs that used managed object-code is faster than byte-code interpreters. Managed object-code has the least amount of indirection compared to byte-code that has the most indirection.

LLVM exemplified Alsup's contradiction where that byte-code is either input for the run-time layer or is input for the compile-time layer. Alsup personified law where he said, “No law is directly on point.” Said that way made law appear as said “computer program” because of its stated level of indirection. By the book, Judges are immoral when they present their position equal to any JOB, and I have seen and heard it happen. You have heard of job queues, and you have heard of trial-by-court instead of trial-by-jury. It seemed nice when Judges compiled their decision (with/with-out the jury) into “human-readable language,” but that is not their job. Like LLVM, there was an ulterior motive, yet Alsup obviated it. I concluded here before I judge any of these into some other personification of the cross-compiler, virtual cross-compiler, legal avatars, etc..., as I do not judge...

“His Honor is now qualified for at least an entry-level position as a Java programmer”
– @groklaw

Moral or natural, one certain result is sympathy.