2 ms·
Well, libraries are probably the largest reason, as providing access to native libraries is much harder (if possible at all) on LLVM due to the lack of reflecti
by yoklov 14y ago
Well, libraries are probably the largest reason, as providing access to native libraries is much harder (if possible at all) on LLVM due to the lack of reflection in C or C++.
Aside from libraries, other reasons for it being unpopular include JIT compilation being slow for LLVM (compared to hand rolled implementations) lack of a mature GC infrastructure (for decent performance, iirc you are best off rolling your own with little/no help from LLVM) and general difficulties with the performance of compiled code for dynamic languages (many of its optimizations, e.g. LICM, TBAA, etc are unsuitable for dynamic languages. Other optimizations get tripped up by type guards, and cant do much useful work). Not to mention that LLVM is huge, and it can be a painful dependancy (especially given the above)
Another problem for LLVM as a portable platform is that LLVM bytecode is, well, not portable. I mean, how could it be? It must be able to encode the semantics of C, which is inherently non-portable (especially after e.g. sizeof has been replaced with machine dependant sizes).
That's not to say LLVM is not awsome, because it is--very much so. But LLVM's design goals have never included being a platform, as thats likely at odds with it being a great compiler for languages like C/C++. (Maybe not, but it certainly seems that way to me)
Edit: just realized you said apart from libraries. Rephrased some stuff to highlight other points