So regarding my assumptions about translating the D front end expressions to GCC? Is that all simpler than I imagine?<div>Do you think GDC generates optimal code comparable to C code?</div><div><br></div><div>What about pure functions, can you make good on optimisations like caching results of pure functions, moving them outside loops, etc?<br>
<br><div class="gmail_quote">On 6 January 2012 00:03, Iain Buclaw <span dir="ltr"><<a href="mailto:ibuclaw@ubuntu.com">ibuclaw@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 5 January 2012 16:49, Manu <<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>> wrote:<br>
>> D is not a compiler, it is a language. Furthermore it is not true that<br>
>> DMDs backend is rubbish and there are already more backends than just the<br>
>> DMC backend.<br>
><br>
><br>
> Sorry, I was generalising a little general in that claim. And where I say<br>
> 'rubbish', I was drawing comparison to the maturity of C compilers for x86,<br>
> which STILL have trouble and make lots of mistakes with centuries of man<br>
> hours of work.<br>
> DMD has inferior code gen (there was a post last night comparing some<br>
> disassemblies of trivial programs with GDC), will probably never rival GCC,<br>
> that's fine, it's a reference, I get that.<br>
> But to say that using GDC will magically fix code gen is also false. I'm not<br>
> familiar with the GCC code, so I may be wrong, but my understanding is that<br>
> there is frontend work, and frontend-GCC glue work that will allow for back<br>
> end optimisation (which GCC can do quite well) to work properly. This is<br>
> still a lot of work for a small OSS team.<br>
> I also wonder if the D language provides some opportunities for optimisation<br>
> that aren't expressible in other languages, and therefore may not already<br>
> have an expression in the GCC back end... so I can imagine some of future<br>
> optimisations frequently discussed in this forum won't just magically appear<br>
> with GCC/LLVM maturity. I can't imagine Iain and co extending the GCC back<br>
> end to support some obscure D optimisations happening any time soon.<br>
><br>
<br>
</div>Actually, it's just me. ;)<br>
<br>
So far I have come across no D optimisations that aren't supported in<br>
GCC.  Infact, most of the time I find myself thinking of how I can use<br>
obscure GCC optimisation X to improve D.    One example is an<br>
interesting feature of Fortran, though written with C++ in mind. Seems<br>
like something that could be right up D's street.<br>
<br>
<a href="http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=147822" target="_blank">http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=147822</a><br>

<div class="HOEnZb"><div class="h5"><br>
--<br>
Iain Buclaw<br>
<br>
*(p < e ? p++ : p) = (c & 0x0f) + '0';<br>
</div></div></blockquote></div><br></div>