HN2new | past | comments | ask | show | jobs | submitlogin
LLVM 2.7 Released (llvm.org)
75 points by xearl on April 27, 2010 | hide | past | favorite | 11 comments


Does anyone know how this compares with the JVM? I know that there is a java front-end for LLVM, but I haven't seen much comparison information (to be honest, haven't looked that hard either)

Can this be a good way to get (for example) Java code to interact with .net code? Get cross platform compatibility?

I may not be the smartest in this area, but can't seem to get a grasp on exactly why LLVM is so great, and what it enables compared to (for example) the JVM.


LLVM is a good deal lower-level than the JVM. It lets you build representations of a program in an internal representation that's higher-level than assembly but doesn't limit you as much as the JVM; for example, it doesn't come with a built-in garbage collector and allows tail-call optimization. LLVM makes a great compiler back-end, does a bunch of optimizations, and can be used at runtime to do on-the-fly compilation.

Once VMKit is more stable, it'll be able to run Java code and .NET code on the same LLVM-based VM, which is nice.

LLVM supports a bunch of different processors and platforms as backends. If you're writing a compiler, this is a godsend.


LLVM's intermediate representation is more low-level than JVM bytecode and provides no safety guarantees, allowing it to be used for any language including C. LLVM does not provide a language runtime, garbage collector, or JIT compiler. In fact, its principal use right now is as the backend of ahead-of-time compilers like GCC and Clang.

What LLVM does provide is a bunch of optimizers that operate on LLVM IR, and a bunch of code generators that take LLVM IR and spit out machine code for different CPUs. Traditionally these things have been inseparable parts of a larger monolithic codebase (e.g. GCC). Compiler writers can now reuse LLVM's optimizers and code generators instead of writing their own, and instead focus on the frontend parts where all the interesting language features live.


Actually, LLVM does provide a JIT compiler. It supports both AOT and JIT compilation.


LLVM is more like a C virtual machine. It's basically there to replace the gcc compiler with a compiler and virtual machine.


Clang is currently the most active LLVM project, but it is hardly the fundamental purpose of LLVM. It's just that C happens to be both the most widely used language in the world and the one that Apple has the most interest in backing.


In case I'm not the only non-coder here who wanted a bit more background on what LLVM is:

http://en.wikipedia.org/wiki/Llvm


The root of the linked side, http://llvm.org/ , should be considered the authoritative source for what LLVM is.


You're 100% correct, but quite often I find that Wikipedia offers a broader view of what something is than the official website's description.


Indeed, but for non-coders, Wikipedia tends to be easier to understand, and the links to other Wikipedia pages make it easy to look things up.


Anyone knows what the situation is with exception handling on windows?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: