<p>On Mar 5, 2013 6:56 AM, "Daniel Murphy" <<a href="mailto:yebblies@nospamgmail.com">yebblies@nospamgmail.com</a>> wrote:<br>
><br>
> "David Nadlinger" <<a href="mailto:see@klickverbot.at">see@klickverbot.at</a>> wrote in message<br>
> news:tbfgbhevqojgnawnxgns@forum.dlang.org...<br>
> ><br>
> > Second, rewriting all of *LDC's* code in D would be a huge task, as the<br>
> > use of C++ templates is pervasive through the LLVM C++ API (even if they<br>
> > are used pretty judiciously), and the LLVM C API is a lot less powerful in<br>
> > some aspects. Thus, care should be taken that the D frontend can actually<br>
> > be used with some of the virtual method implementations still in C++ (e.g.<br>
> > toElem/toElemDtor and similar LDC-specific ones).<br>
> ><br>
> > Your (Andrei's) initial post sounded like this would be the case. But if I<br>
> > interpreted some of the posts correctly, Daniel Murphy has an automatic<br>
> > translator in the works for porting over the whole compiler (except for<br>
> > the backend) at once, which might be a problem for LDC.<br>
> ><br>
> > David<br>
><br>
> I think we can solve this, but it's a lot of work.<br>
><br>
> 1. Refactor the glue layer to use a proper visitor pattern<br>
> 2. Implement extern(C++) classes (where<br>
> <a href="https://github.com/D-Programming-Language/dmd/pull/644">https://github.com/D-Programming-Language/dmd/pull/644</a> was supposed to be<br>
> headed)<br>
><br>
> This should allow us to have the dmd glue layer written in D, with the<br>
> ldc/gdc glue layers written in c++.<br>
><br>
> It would require all three glue layers to be refactored together, but I<br>
> don't see a way to avoid this.  Hopefully we can get rid of most of the<br>
> gdc/ldc specific frontend patches along the way.<br>
><br>
> What do you and Iain think about this approach?<br>
><br>
></p>
<p>I think C++ classes would be more ill to implement than what I see initially in that link. </p>
<p>Mangling is another problem as well.  I've seen differing C++ compilers have subtle differences.  I'll try to find one discrepancy between D and g++.<br></p>
<p>Regards<br>
-- <br>
Iain Buclaw</p>
<p>*(p < e ? p++ : p) = (c & 0x0f) + '0';</p>