Thread overview
Why do we still need/use .di 'header' files?
Nov 17, 2006
Lionello Lunesu
Nov 17, 2006
Don Clugston
Nov 17, 2006
John Reimer
Nov 17, 2006
BCS
Nov 17, 2006
Daniel Keep
Nov 19, 2006
Don Clugston
Nov 18, 2006
Lionello Lunesu
November 17, 2006
Wouldn't it be possible to make a tool that dumps the symbols from objs/libs, undoing any name-decoration?

And wouldn't it be possible to built that tool right into the compiler?

I don't know if protection attributes are being encoded in a decorated name, but that issue wouldn't be hard to overcome.

L.
November 17, 2006
Lionello Lunesu wrote:
> Wouldn't it be possible to make a tool that dumps the symbols from objs/libs, undoing any name-decoration?
> 
> And wouldn't it be possible to built that tool right into the compiler?
> 
> I don't know if protection attributes are being encoded in a decorated name, but that issue wouldn't be hard to overcome.
> 
> L.

Protection attributes and many other things are not in the decorated names.
What about templates, and conditional compilation?
November 17, 2006
"Don Clugston" <dac@nospam.com.au> wrote in message news:ejkbnm$1qb1$1@digitaldaemon.com...
>
> Protection attributes and many other things are not in the decorated
> names.
> What about templates, and conditional compilation?

This is why there needs to be a "D object file" format.. :P  That would be a killer feature IMO.


November 17, 2006
Don Clugston wrote:
> What about templates, and conditional compilation?

if you are taking about closed source libs, that isn't an issue. It would be nice to have a tool that would walk a .o/.a/.lib file (that doesn't come with source) and generate a .di file that lets you link to it.

Just dreaming I guess.


November 17, 2006
On Fri, 17 Nov 2006 07:17:41 -0800, Jarrett Billingsley <kb3ctd2@yahoo.com> wrote:

> "Don Clugston" <dac@nospam.com.au> wrote in message
> news:ejkbnm$1qb1$1@digitaldaemon.com...
>>
>> Protection attributes and many other things are not in the decorated
>> names.
>> What about templates, and conditional compilation?
>
> This is why there needs to be a "D object file" format.. :P  That would be a
> killer feature IMO.
>
>


Totally agree with this!  It would also shed a whole lot of other problems for D.
November 17, 2006
Jarrett Billingsley wrote:
> "Don Clugston" <dac@nospam.com.au> wrote in message news:ejkbnm$1qb1$1@digitaldaemon.com...
> 
>>Protection attributes and many other things are not in the decorated names.
>>What about templates, and conditional compilation?
> 
> 
> This is why there needs to be a "D object file" format.. :P  That would be a killer feature IMO. 
> 
> 

It might kill C compatability in some cases... /but/ having such a thing, with perhaps a compiler switch to emit "legacy" object files, would be nice -- and would make DDL far, far simpler to implement I'm sure.

-- Chris Nicholson-Sauls
November 17, 2006

BCS wrote:
> Don Clugston wrote:
>> What about templates, and conditional compilation?
> 
> if you are taking about closed source libs, that isn't an issue. It
> would be nice to have a tool that would walk a .o/.a/.lib file (that
> doesn't come with source) and generate a .di file that lets you link to it.
> 
> Just dreaming I guess.
> 

If the object file was compiled by D, it shouldn't be too hard.  As Don said, you won't get templates, conditional compilation switches, protection attributes, etc., but it should work in general.

But if that bugger's got C linkage, forget it.  C linkage tells you the name and nothing more.  And since in C the callee cleans up the stack, you can't even reliably disassemble the ASM to work out what kinds of arguments it takes (at least, not to my knowledge.)

<2¢>

Maybe what would work is if we defined a wrapper format, like DDL files, that takes the generated object file (of whatever format the native machine supports), and wraps it with additional information.

That, or we could just get DDL built into the standard D toolchain.

(Also just dreaming :P)

</2¢>

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/
November 18, 2006
"Don Clugston" <dac@nospam.com.au> wrote in message news:ejkbnm$1qb1$1@digitaldaemon.com...
> Protection attributes and many other things are not in the decorated
> names.
> What about templates, and conditional compilation?

If you depend heavily on templates/conditional compilation, you'd be forced to release the source, and that makes sense. But what if I have a old-school lib with no need for templates?

OT: I'm really afraid that D's dropping old-school, and going all fancy with meta-programming'n'shit. Frankly, I don't want to write meta-code that will then generate code for the compiler to compile... Templates are nice, but everything should also be possible without them...

L.


November 19, 2006
BCS wrote:
> Don Clugston wrote:
>> What about templates, and conditional compilation?
> 
> if you are taking about closed source libs, that isn't an issue.

No, I wasn't. Just pointing out that source->obj is a lossy process, it's not fully reversible (unless you include most of the source in the obj file, which I think defeats most of the purpose).


 It
> would be nice to have a tool that would walk a .o/.a/.lib file (that doesn't come with source) and generate a .di file that lets you link to it.
> 
> Just dreaming I guess.