www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: LLVM 2.6 Release!

reply Justin Johansson <no spam.com> writes:
Andrei Alexandrescu Wrote:

 Justin Johansson wrote:
 Denis Koroskin Wrote:
 Amazon mentions March 15, 2010:
 http://www.amazon.com/exec/obidos/ASIN/0321635361/modecdesi-20

Thanks; just had a look at that link. Did Andrei give a preview of the table of contents somewhere? I'd certainly welcome a chapter (or at least a detailed honorable mention) on LLVM though perhaps that would be outside of the scope of his book.

An overview of LLVM/ldc would be outside of the scope of the book, but I encourage you to write about it and I'll make sure I'll insert a pointer in the book. Andrei

Sorry Andrei; I missed this reply by you until now. My interest in LLVM is largely outside of D but I think it is a really important technology for the future of D. (I have another non-D LLVM project that I'm working on in slow time.) Currently I don't actually use ldc because of its Tango affinity. Nevertheless it would be good if you can get someone from the ldc community to produce a salient one-pager on why LLVM for D to make reference to in your book. Justin
Oct 28 2009
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Justin Johansson wrote:
 Andrei Alexandrescu Wrote:
 
 Justin Johansson wrote:
 Denis Koroskin Wrote:
 Amazon mentions March 15, 2010:
 http://www.amazon.com/exec/obidos/ASIN/0321635361/modecdesi-20

Did Andrei give a preview of the table of contents somewhere? I'd certainly welcome a chapter (or at least a detailed honorable mention) on LLVM though perhaps that would be outside of the scope of his book.

encourage you to write about it and I'll make sure I'll insert a pointer in the book. Andrei

Sorry Andrei; I missed this reply by you until now. My interest in LLVM is largely outside of D but I think it is a really important technology for the future of D. (I have another non-D LLVM project that I'm working on in slow time.) Currently I don't actually use ldc because of its Tango affinity. Nevertheless it would be good if you can get someone from the ldc community to produce a salient one-pager on why LLVM for D to make reference to in your book. Justin

Sounds good, thanks. If anyone is up to the task, we'd all be grateful. Andrei
Oct 28 2009
parent reply bearophile <bearophileHUGS lycos.com> writes:
Andrei Alexandrescu:

 Sounds good, thanks. If anyone is up to the task, we'd all be grateful.

LLVM is good for D/LDC for several things: - The LLVM optimizer is good, usually quite better than the DMD one. If you write D C-like code you usually reach performance similar to true C code. - LLVM misses some optimizations, like de-virtualization, auto-vectorization, and some more, but LLVM is a very alive project (partially paid by Apple) so probably eventually those things will be added. I have shown bugs to LLVM people and they have fixed it in few days. They were almost as fast as LDC developers (lately LDC devs seem sleepy to me). - LLVM is written in a good enough C++, its API is not bad. You can use LLVM for your purposes in just few days for small projects. Try doing the same thing with GCC. - LLVM is not a compiler, it's a compilation framework. More and more projects use it in several different ways. D is not a VM-based language, but eventually it can even be possible for LDC to compile and run code at runtime, for example to instantiate templates at runtime. LLVM can be used for several other things. - LLVM will probably offer ways to implement a lint tool for D. - LLVM is designed for all different kinds of purposes, so inside it you can find things like overflow-safe fixed-sized integers, stack canaries, other stack protection means, ways to design a precise GC that keeps in account the stack too (and eventually registers too). - LLVM offers and will offer some modern things, like link-time optimization, a good (goden) linker, an ecosystem of tools that work and can communicate to each other using reliable languages like bc and ll. - You can use LLVM on 64 bit CPUs too, and eventually exceptions on Windows too, etc. Some of the other optimizations useful for C++ (de-virtualization) will be pushed in the back-end (and not in the new front-end Clang) so they will be usable by LDC too for free. - LLVM is made of parts, so you can use them and re-combine them for many different purposes. There are many research papers written on and with llvm, and more will come, because hacking llvm is quite simpler than doing similar things with gcc (despite gcc 4.5 has now a plug-in system. LLVM doesn't need it because it works in the opposite way). So LLVM will allow to do things that today we haven't invented yet. - Some of the top LLVM developers are paid by Apple, this has disadvantages too. You can see an example of this from the missing videos/PDFs of the last conference, they were not allowed to show them, because Apple is sometimes even more corporative than Microsoft: http://llvm.org/devmtg/2009-10/ Bye, bearophile
Oct 28 2009
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
bearophile wrote:
 Andrei Alexandrescu:
 
 Sounds good, thanks. If anyone is up to the task, we'd all be grateful.

LLVM is good for D/LDC for several things:

Thanks. Just in case I was misunderstood - I said: If anyone would want to write an article (e.g. a blog entry, magazine article, self-published Web article etc., but not a newsgroup article) about ldc, I'd be glad to cite it and link to it from within TDPL. Andrei
Oct 28 2009
prev sibling parent Nick B <"nick_NOSPAM_.barbalich" gmail.com> writes:
bearophile wrote:
 Andrei Alexandrescu:

You can see an example of this from the missing videos/PDFs of the last conference, they were not allowed to show them, because Apple is sometimes even more corporative than Microsoft:
 http://llvm.org/devmtg/2009-10/
 
 Bye,
 bearophile

Bearophile Thanks for the link. By the way there is quite a interesting talk from David Greene from CRAY using LLVM titled "LLVM on 180k Cores". cheers Nick B.
Oct 28 2009