4 ms·
Does this make more sense than targeting LLVM? It doesn't seem easier to maintain, and you won't get the advantages of the optimizations/work already done.
by fizx 17y ago
Does this make more sense than targeting LLVM? It doesn't seem easier to maintain, and you won't get the advantages of the optimizations/work already done.
- notaddicted 17y agog++ has a few optimizations http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
- spoondan 17y agoI doubt he was somehow ignorant of the fact that g++ optimizes its generated code. I believe his point was that great work has already been done on optimizing compilers for dynamic languages targeting LLVM (c.f., Unladen Swallow and Rubinius).
- orblivion 17y agoWas just thinking the same thing. "Man, I guess it works, but isn't it weird that they're generating what's probably hard to read C++ just to get fast machine code? Eventually they should make a language just for the purpose of optimizing. Oh wait."
- alxv 17y agoAccording to the Unladen Swallow's team [1], LLVM's "just-in-time infrastructure was relatively untested and buggy" when they started working with it. So, I think not using LLVM was a pragmatic decision. In addition, debugging C++ code is much easier than dealing with intricacies of dynamically generated machine code. [1]: http://www.python.org/dev/peps/pep-3146/#performance-retrospective http://www.python.org/dev/peps/pep-3146/#performance-retrosp...
- kingkilr 17y agoYes, but it's not now. Unladen Swallow isn't exactly alone in blazing this trail, Rubinius is using LLVM as well.
- wmf 17y agoHipHop is a static compiler, though. That part of LLVM seems to have been heavily exercised by GCC and Clang.
- malkia 17y agoWell maybe The Facebook guys were not only after speed optimization, but memory too. No matter how great the LLVM JIT is it probably uses some memory to compile the code, and this way wasting some amount. Static compilation would not waste this amount. I'm actually proponent of JIT, over static compilation, but only for my little pet projects. I don't know much about WEB, but for games development, static compilation is sometimes the only way to go (or script interpretation). Sometimes there is just not enough memory, and sometimes it's restricted (hell, it so much resticted that you can't change the VTABLE at runtime in C++ class even if you want to)