Hacker News new | past | comments | ask | show | jobs | submit login

LLVM actually still is a virtual machine, since it contains mechanisms for executing code written in LLVM IR. There are two execution paths - an interpreter and a JIT compiler. I guess this makes it a VM after all, although the acronym is no longer descriptive because the VM part is a tiny fraction of what LLVM includes and can do. As you said, its super-tool for creating compilers, especially compiler back-ends.



The LLVM interpreter is less than ideal as an actual interpreter rather than something for doing constant folding and that kind of thing; the instructions are too low-level for it to be really fast. For example, bit widths of integers are represented in the abstraction; that adds overhead to even the simplest of arithmetic operations.


I don't think the interpreter was intended to be really fast. It's pretty good for debugging and platform-independent execution. For speed there's the JIT.




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

Search: