Thread overview
D compiler embedding
May 04, 2009
Peloto
May 04, 2009
Simen Kjaeraas
May 04, 2009
Robert Fraser
May 04, 2009
Jason House
May 04, 2009
Can I embed the D compiler into my application? For example:

Dcompiler c;
Dcompiler::result *r = c.compile("mySource.d");
fstream f("result.bin");
f.write(r->GetBuffer(),r->GetNBytes());

And other doubt... where's the Solaris port for the D compiler? I see only Windows, linux, freeBSD and MacOSX.

thx.
May 04, 2009
Peloto wrote:

> Can I embed the D compiler into my application? For example:
>
> Dcompiler c;
> Dcompiler::result *r = c.compile("mySource.d");
> fstream f("result.bin");
> f.write(r->GetBuffer(),r->GetNBytes());

Short answer: No.

Long answer: Several people have been asking for this, and there has been at least one implementation. Burton Radons wrote http://members.shaw.ca/burton-radons/The%20Joy%20and%20Gibbering%20Terror%20of%20Custom-Loading%20Executables.html, which I have not myself tried, but it seems like it should do what you ask for.


--
 Simen
May 04, 2009
Peloto wrote:
> And other doubt... where's the Solaris port for the D compiler? I see only Windows, linux, freeBSD and MacOSX.

http://www.dsource.org/projects/ldc

May 04, 2009
Robert Fraser Wrote:

> Peloto wrote:
> > And other doubt... where's the Solaris port for the D compiler? I see only Windows, linux, freeBSD and MacOSX.
> 
> http://www.dsource.org/projects/ldc
> 

The Phobos changelog implies the next D1 release will have Dolaris support. D2 support is on hold due to other drastic changes. Regardless, LDC is a good recommendation; it supports a lot of platforms dmd does not. I'm still hoping for 64 bit support in dmd.