November 20, 2006
Charlie wrote:

> A third D compiler would be very cool, especially if its around when D goes 1.0.

I already mentioned my attempts on a D ABI for which I planned to fork GDC. I think, this is the perfect moment to get my LLVM based D compiler started. So in 3 words:

I'm on it!

Wolfgang Draxinger
-- 
E-Mail address works, Jabber: hexarith@jabber.org, ICQ: 134682867

November 20, 2006
On Mon, 20 Nov 2006 10:56:53 -0800, Craig Black <cblack@ara.com> wrote:

> LLVM (http://llvm.org/) is a backend for compilers.  It is portable to many
> platforms, well documened, and actively developed.  It seems that they are
> making great progress with it.
>
> A crazy idea.  Has anyone considered using LLVM with D's front end?  I know
> Walter has his own back end, but it's seems hard for one guy to maintain
> both a front and back end, and do a good job at both.  Even a programming
> god like Walter.  If we had the LLVM team actively developing and innovating
> the back end, then Walter could focus on innovating the front end and the D
> language.  Just a thought.
>
> -Craig
>
>


I like this idea! I'm not sure how difficult it would be to include a D frontend with the default distribution (in the way that several gcc frontends seem to be included), but the licensing certainly appears to be quite accommodating.

-JJR
November 20, 2006
Charlie wrote:
> 
> 
> Gregor Richards wrote:
> 
>> Charlie wrote:
>>
>>> A third D compiler would be very cool, especially if its around when D goes 1.0.
>>>
>>> Craig Black wrote:
>>>
>>>>> I have tried it with LLVM's GCC and GDC.  It didn't work out-of-the-box, but I don't think it would take a whole lot of hackery.
>>>>>
>>>>>  - Gregor Richards
>>>>
>>>>
>>>>
>>>> How long ago did you try this?  LLVM just released a new 1.9 version that they claim is way better.  I'm not sure what you mean by out-of-the-box. But, like you say, I don't think it would be a massive effort.  It seems that LLVM is pretty well thought out.
>>>>
>>>> -Craig
>>>>
>>
>> LLVM uses GCC, so in all fairness it would hardly be a third D compiler, it would just be another face of GDC.
>>
>>  - Gregor Richards
>
> Hmm, I don't think it uses GCC as a backend.
>
>  From the website: We find that LLVM is able to compile C++ into
> substantially better code than GCC .
>
> It says it can use the GCC front-end for its LLVM backend, which I think
> is the opposite of GDC, which uses DMD front end to produce a tree
> usable by GCC backend.
>
> I think DMD Frontend translated to LLVM backend would be completely
> independent of GCC, and the more compilers the better!
>
> Charlie

)top-post don't please(


Normal GCC (simplified):
[C] code -> GIMPLE -> target ASM

LLVM GCC (simplified):
[C] code -> GIMPLE -> LLVM ASM

Normal GDC (simplified);
D code -> GIMPLE -> target ASM

LLVM GDC (simplified):
D code -> GIMPLE -> LLVM ASM


The same component of GCC (namely, the IR, GIMPLE) is both a backend to GDC and a frontend to LLVM.

 - Gregor Richards
November 20, 2006
>
> I'm on it!
>

Excellent!  I'm very curious about performance comparisons.  Keep us posted!

-Craig


November 20, 2006
Craig Black wrote:
> LLVM (http://llvm.org/) is a backend for compilers.  It is portable to many platforms, well documened, and actively developed.  It seems that they are making great progress with it.
> 
> A crazy idea.  Has anyone considered using LLVM with D's front end?  I know Walter has his own back end, but it's seems hard for one guy to maintain both a front and back end, and do a good job at both.  Even a programming god like Walter.  If we had the LLVM team actively developing and innovating the back end, then Walter could focus on innovating the front end and the D language.  Just a thought.
> 
> -Craig 
> 
> 

Hmmm... looks like they are working on an ARM backend.  This could be nice.  If they get that ARM backend done by say, summer of next year, and the D front-end is plugged in, then I might be willing to take a crack at making ARM work on that one in addition to GDC.  Then I could decide which one is nicer to work with and focus on that.  Kind of a longshot though (they'd need wince support too).

Admittedly the current arm-wince-pe GDC I put together has some uh ...annoyances...   and I've no idea how to solve them.

Now I wonder, is Walter really maintaining the backend much?  I thought that part of dmd was pretty solid already and he is just focusing on the front-end and other D affairs.

What would impress me is if the main development of D would occur on this LLVM compiler, or at least be readily portable to it within hours or a few days (this assumes LLVM is a good quality backend that Walter wouldn't mind switching to).  The utility I am looking for there is having a bleeding-edge D compiler that is also very retargetable, and doesn't require big man-hours to be maintained as it seems gdc does. DMD is great on windows, but it is fairly useless on my pda since, well, it doesn't even generate code for that at all!
November 20, 2006
On Mon, 20 Nov 2006 13:41:28 -0800, Chad J <gamerChad@_spamIsBad_gmail.com> wrote:

> Craig Black wrote:
>> LLVM (http://llvm.org/) is a backend for compilers.  It is portable to many platforms, well documened, and actively developed.  It seems that they are making great progress with it.
>>  A crazy idea.  Has anyone considered using LLVM with D's front end?  I know Walter has his own back end, but it's seems hard for one guy to maintain both a front and back end, and do a good job at both.  Even a programming god like Walter.  If we had the LLVM team actively developing and innovating the back end, then Walter could focus on innovating the front end and the D language.  Just a thought.
>>  -Craig
>
> Hmmm... looks like they are working on an ARM backend.  This could be nice.  If they get that ARM backend done by say, summer of next year, and the D front-end is plugged in, then I might be willing to take a crack at making ARM work on that one in addition to GDC.  Then I could decide which one is nicer to work with and focus on that.  Kind of a longshot though (they'd need wince support too).
>
> Admittedly the current arm-wince-pe GDC I put together has some uh ...annoyances...   and I've no idea how to solve them.
>
> Now I wonder, is Walter really maintaining the backend much?  I thought that part of dmd was pretty solid already and he is just focusing on the front-end and other D affairs.
>
> What would impress me is if the main development of D would occur on this LLVM compiler, or at least be readily portable to it within hours or a few days (this assumes LLVM is a good quality backend that Walter wouldn't mind switching to).  The utility I am looking for there is having a bleeding-edge D compiler that is also very retargetable, and doesn't require big man-hours to be maintained as it seems gdc does. DMD is great on windows, but it is fairly useless on my pda since, well, it doesn't even generate code for that at all!


I'm wondering if Walter will have the same source "tainting" issue with LLVM as he did for gcc.  I wish not because it would be much better if the reference compiler development could continue on a completely open system.

-JJR
November 20, 2006
"Lionello Lunesu" <lionello@lunesu.remove.com> wrote in message news:ejt4m7$2o18$1@digitaldaemon.com...
> Great idea!
> I just noticed however that their IR language has no "real" (long double)
> float representation?
>
> L.
>


Good point.  Perhaps someone could suggest that they add one.

-Craig


November 20, 2006
John Reimer wrote:
> On Mon, 20 Nov 2006 13:41:28 -0800, Chad J  <gamerChad@_spamIsBad_gmail.com> wrote:
> 
>> Craig Black wrote:
>>
>>> LLVM (http://llvm.org/) is a backend for compilers.  It is portable to  many platforms, well documened, and actively developed.  It seems that  they are making great progress with it.
>>>  A crazy idea.  Has anyone considered using LLVM with D's front end?  I  know Walter has his own back end, but it's seems hard for one guy to  maintain both a front and back end, and do a good job at both.  Even a  programming god like Walter.  If we had the LLVM team actively  developing and innovating the back end, then Walter could focus on  innovating the front end and the D language.  Just a thought.
>>>  -Craig
>>
>>
>> Hmmm... looks like they are working on an ARM backend.  This could be  nice.  If they get that ARM backend done by say, summer of next year,  and the D front-end is plugged in, then I might be willing to take a  crack at making ARM work on that one in addition to GDC.  Then I could  decide which one is nicer to work with and focus on that.  Kind of a  longshot though (they'd need wince support too).
>>
>> Admittedly the current arm-wince-pe GDC I put together has some uh  ...annoyances...   and I've no idea how to solve them.
>>
>> Now I wonder, is Walter really maintaining the backend much?  I thought  that part of dmd was pretty solid already and he is just focusing on the  front-end and other D affairs.
>>
>> What would impress me is if the main development of D would occur on  this LLVM compiler, or at least be readily portable to it within hours  or a few days (this assumes LLVM is a good quality backend that Walter  wouldn't mind switching to).  The utility I am looking for there is  having a bleeding-edge D compiler that is also very retargetable, and  doesn't require big man-hours to be maintained as it seems gdc does. DMD  is great on windows, but it is fairly useless on my pda since, well, it  doesn't even generate code for that at all!
> 
> 
> 
> I'm wondering if Walter will have the same source "tainting" issue with  LLVM as he did for gcc.  I wish not because it would be much better if the  reference compiler development could continue on a completely open system.
> 
> -JJR

I have now posted this at least three times.

LLVM's compiler is GCC.

 - Gregor Richards
November 20, 2006
Craig Black wrote:

>>I just noticed however that their IR language has no "real" (long double) float representation?
> 
> Good point.  Perhaps someone could suggest that they add one.

Just use the "double" type, that is what PowerPC does anyway...

--anders
November 20, 2006
John Reimer wrote:
> I'm wondering if Walter will have the same source "tainting" issue with LLVM as he did for gcc.

Yes, since it is copyrighted. However, I *can* read documentation about the compiler (one cannot copyright an idea, ideas are covered by patent law, not copyrights).

Aside from working with the LLVM source, I am happy to help out in any way I can those who want to integrated the D front end with LLVM.

One advantage LLVM has over gcc is that gcc is reluctant to include gdc as part of the default gcc distribution. If LLVM is willing to include D with their main distribution, that would be very good for D users.