The forked elephant in the room

bachmeier no at spam.net
Tue Jan 30 17:35:35 UTC 2024


On Tuesday, 30 January 2024 at 15:53:50 UTC, Mike Parker wrote:
> On Tuesday, 30 January 2024 at 15:44:28 UTC, Mike Parker wrote:
>> On Tuesday, 30 January 2024 at 15:36:34 UTC, Mike Parker wrote:
>>>
>>>
>>> There were discussions about the possibility of dmd compiling 
>>> C code several years ago. My search attempts keep turning up 
>>> way too many pages, but this is an old idea in the D 
>>> community.
>>
>> Okay, here's an early discussion. Not exactly the same, but in 
>> the ballpark:
>>
>> https://www.digitalmars.com/d/archives/22625.html
>>
>
> And here's the earliest discussion of an ImportC-style thing 
> that I can find (2006):
>
> https://www.digitalmars.com/d/archives/digitalmars/D/35483.html
>
>> Why not enable dmd to "import" C header files directly?
>
> One of the commenters listed this as a point against:
>
>> 2. Writers of other D compilers will feel compelled to build 
>> in a C compiler so that they can compile such projects.

That's a lot earlier than what I found, but my recollection was 
that it had been floating around the whole time I've been using 
D. The idea isn't important for something like this - 
implementation is all that matters.

I attempted to hack a solution like ImportC at one time, with a 
script that would call dstep, a C compiler, and dmd. The 
compilation command was similar to what we have today. That went 
down in flames quickly because dstep couldn't fully translate 
headers.


More information about the Digitalmars-d mailing list