D compiler embedding

Simen Kjaeraas simen.kjaras at gmail.com
Sun May 3 23:00:09 PDT 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



More information about the Digitalmars-d mailing list