danger/u/
This thread is permanently archived
what's wrong whith llvm?

| Why the fuck would you name something llmv? llvm.org says it's not an acronym, so I'm confused.


| It originally stands for 'Low Level Virtual Machine', referring to the whole project of LLVM. However, to avoid confusion, this acronym is no longer valid (because a 'VM' in common speak usually refers to system virtual machine, the likes of QEMU).


| >>687642 I haven't looked into it so correct me, it's "virtual machine" in the sense of an intermediate language right?
Like Java bytecode


| >>688045
Partially correct. You are correct in a sense that it somewhat works similarly like JVM, however, LLVM isn't a complete VM by itself (even in that sense).

Instead, what the 'low-level virtual machine' is referring to is the IR or Intermediate Representation — essentially, this is source code that has been processed by the compiler, and can be transformed to a program (but it isn't yet a program!).

(Cont...)


| What is interesting is that LLVM does NOT care what language you use (as long as it is supported); all languages will be transposed to the LLVM IR (bytecode), and this IR can be ran through a JIT compiler (lli) — this is the aspect that is similar to JVM.

As you can see, you can for instance, take a C code and run it through lli after you emit the IR of said code. Or you can change the code to C++ — lli does not care, as long as it is interpreting IR. Hence, the VM part.


| Now, what makes this different from JVM and why did I say it's not a 'complete VM'?

A code that has been emitted to an IR is still architecture-dependent; you can't run an IR made for x86 to, say, ARM. This is different with Java, as with Java bytecode, it will run as long as the JVM exists (and assuming the code doesn't specifically call for architecture-specific calls) — JVM is does not care for architecture, but LLVM does.


| I hope that satisfies your curiosity^^ feel free to ask me anything regarding this topic, as it happens to be my field of interest as well.


| Not OP but that sounds fucking amazing

Total number of posts: 8, last modified on: Fri Jan 1 00:00:00 1597246793

This thread is permanently archived