Add ImportC compiler to dmd

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon May 10 11:03:43 UTC 2021


On Monday, 10 May 2021 at 10:03:48 UTC, Basile B. wrote:
> There are chances that the discussion will derivate on the 
> topic of full translation of C while the point is rather to 
> translate headers i.e **declarations** and only that. Like if 
> it can handle most commonly used c headers, let's say zlib, 
> ssl, etc. it's ok. What people want is more like cairo headers, 
> llvm headers, x11 headers, etc. to be handled.

The topic presented is to translate C code to D's high level IR 
after cpp.

My point is that you don't need to translate headers if you have 
an external tool that accept a set of header files and a 
C-expression and provide a mechanism to do reflection on that 
expression.

What you need then is some way to translate D-constructs to 
C-constructs which shouldn't be too hard.

But regardless, D's focus ought to be on memory management and 
fixing issues in the type system. Adding more source code to the 
compiler won't help.

Basic system development strategy:

Refactor first, then fix issues, then add new features.






More information about the Digitalmars-d mailing list