Adding Modules to C in 10 Lines of Code

Daniel N no at public.email
Mon Jun 6 11:23:44 UTC 2022


On Monday, 6 June 2022 at 05:49:55 UTC, Paulo Pinto wrote:
> On Sunday, 5 June 2022 at 22:41:14 UTC, Walter Bright wrote:
>> On 6/4/2022 10:54 PM, Paulo Pinto wrote:
>>> That paper had a real implementation to follow along,
>>
>> I didn't see it.
>>
>>> while Lucid and IBM products were real things one could buy.
>>
>> That are *C* compilers doing imports for *C* code?
>>
>> What C compilers have imports:
>>
>> gcc - nope
>> clang - nope
>> VC - nope
>> Digital Mars C - nope
>> C Standard - nope
>>
>> ImportC - yes!
>
> https://clang.llvm.org/docs/Modules.html
>
> And I am out of this thread.

https://clang.llvm.org/docs/Modules.html#objective-c-import-declaration

"At present, there is no C or C++ syntax for import declarations. 
Clang will track the modules proposal in the C++ committee. See 
the section Includes as imports to see how modules get imported 
today."

So Object-C can import C, but *C* cannot import *C*.

Walter added __import support in *.c, clang could have done the 
same but they *didn't*, they were also probably just 10 lines 
away from the goal.



More information about the Digitalmars-d-announce mailing list