A question about modules - suggestion for convention

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Wed Jun 13 13:53:03 PDT 2007


Robert Fraser wrote:
> As far as your other suggestion goes, have you checked out DDL (http://www.dsource.org/projects/ddl )? It's designed primarily around dynamic libraries, but the format certainly contains enough information for static linking. It would be great if the same format could be used for both static and dynamic linking, though exactly how this would work I can't imagine. The project looks dead, but I think pragma said he plans to get back to it once tango gets to 1.0.

Actually, I believe the way DDL works is that you compile as if you're 
going to link statically to it, and then it doesn't actually link until 
run-time. So linking to files extracted from it should work just fine.
Put the contents of a .di in a metadata field and you have a file 
containing both a binary module and the header to link to it. The build 
utility in use would just have to extract them at the appropriate time 
and use them. (It doesn't look like DDL provides a stand-alone 
extraction utility but I think one could easily be created, either by 
linking to DDL or by writing it from scratch[1]) That would only work 
for contained binaries the current toolchain supports though, not 
arbitrary ones (as IIRC DDL itself supports).


[1] The file format for .ddl files is at 
http://dsource.org/projects/ddl/wiki/Reference/ABI/DDL and looks easy 
enough to parse.



More information about the Digitalmars-d mailing list