No header files?

Yigal Chripun yigal100 at gmail.com
Fri Oct 23 07:23:45 PDT 2009


On 23/10/2009 14:44, Michel Fortin wrote:
> On 2009-10-23 03:52:10 -0400, Yigal Chripun <yigal100 at gmail.com> said:
>
>> I was suggesting to convert *both* obj files and lib files to llvm
>> bit-code. such library files will still contain the metadata.
>>
>> what I ultimately want is to have something similar in concept to .net
>> asseblies/java Jars but with native code (no VM involved). LLVM
>> provides the infrastructure to do exactly this: the compiler generates
>> platform neutral D-assemblies (in llvm bitcode) that can be used on
>> any architecture/OS/llvm-compiler. This would also allow us to use
>> libraries written in other languages when there's an appropriate llvm
>> compiler for them (Ruby, scheme, python, etc).
>
> The LLVM bitcode is too much low-level for that. It won't carry enough
> information about types for correct type checking in D, and it cannot
> express templates. True, you can express arbitrary metadata in bitcode,
> but that'd be a whole new format to create and support...
>
> Perhaps the solution is to embed the "header file" (I mean the '.di'
> file) into the generated object file itself, and make DMD check existing
> object files for an embedded interface. That could work independently of
> the object file format too.
>
>

I like this idea if that's possible to do. And this would require less 
code since .di files are already handled by dmd.
It still leaves the object files themselves platform specific - objects 
generated by two different compilers cannot be used in the same 
executable. But this is a much bigger problem to tackle.




More information about the Digitalmars-d mailing list