CTFE and DI: The Crossroads of D

Paulo Pinto pjmlp at progtools.org
Thu May 10 11:24:04 PDT 2012


Am 10.05.2012 01:01, schrieb Adam Wilson:
> On Wed, 09 May 2012 15:55:36 -0700, Mehrdad <wfunction at hotmail.com> wrote:
>
>>> I am 100% for this. It would be very .NET like. In fact I'm curious
>>> enough what it would take to make this work that I could see myself
>>> trying. My guess is that it needs a new linker with the glorious
>>> side-effect of dumping optlink! In that case it would mean upgrading
>>> the D backend to emit COFF (ELF and Mach-O already support custom
>>> sections), which I am fine with trying to do. Then you would add your
>>> AST or other intermediate representations to a custom section in the
>>> object file and the linker could then link it in. D would then need a
>>> way to extract said information. Which would not be terribly hard.
>>> Except that you'll have to train other compilers how to read that IR.
>>> Maybe we could train D to read the LLVM IR?
>>
>>
>> :O I was writing a response pretty much exactly like this (i.e. doing
>> what .NET does), but then I dumped it, thinking it'd be dismissed as
>> too huge of a change...
>
> :-D This isn't the first time it's been suggested in recent forum
> history. I think there is a significant body of support for making D
> libraries single file with no import files, it solves a *TON* of issues
> around how to import API's. I imagine that it's much the same reason
> .NET went with their metadata plan. And ended up where we are suggesting
> to go.
>

And also possible in languages like Turbo Pascal, Delphi or more recent, Go.

Actually, this is one of the features I really like in Go.

--
Paulo


More information about the Digitalmars-d mailing list