built in import c header files

evilrat evilrat666 at gmail.com
Mon Apr 19 09:09:21 UTC 2021


On Monday, 19 April 2021 at 06:51:54 UTC, FeepingCreature wrote:
> On Tuesday, 6 October 2020 at 20:59:54 UTC, 12345swordy wrote:
>> I remember reading a reddit comment saying that if d were to 
>> import c header files directly without any 3rd party libraries 
>> it would be a game changer. The question is: how difficult to 
>> implement a C AST parser for the dmd front end?
>>
>>
>> -Alex
>
> I've been doing this in both of my compiled languages. (fcc 
> first, built-in, and now in cx as a macro.)
>
> For an example of it in action, check out my glfw sample 
> https://github.com/FeepingCreature/Cx/blob/master/demos/glfw.cx 
> , or the macro code for it 
> https://github.com/FeepingCreature/Cx/blob/master/src/cx/macros/cimport.cx .
>
> ...
>
> I can wholeheartedly recommend any language do this. It unlocks 
> a lot of value and removes a lot of manual work.

Yeah, just until it fails to convert something and blocks 
compilation, where no manual fixes is possible or not even 
allowed by design.


More information about the Digitalmars-d mailing list