Release D 2.087.0

Johannes Pfau nospam at example.com
Mon Jul 15 19:20:27 UTC 2019


Am Mon, 15 Jul 2019 12:27:22 +0000 schrieb Vladimir Panteleev:

> On Monday, 15 July 2019 at 12:14:16 UTC, Mike Franklin wrote:
>> Many of the implementations in `rt/array` require importing or
>> referencing other implementations in `rt` (e.g. `rt.lifetime`).
>>  If they were moved to `core.internal` they would require
>> importing `rt` or peeking into `rt` with various hacks, which exactly
>> what you've said should not be done.
> 
> This isn't exactly true. The restriction is that core should not
> *import* rt. Have a look at all the extern(C) definitions in Druntime -
> using extern(C) functions to communicate between the compiler and rt, as
> well as core and rt, is not a "hack", but an established mechanism to
> invoke the low-level implementations in Druntime.


Grepping for extern in core.internal yields one result outside of 
pareoptions.d. If you count parseoptions.d, 6 results.

I wonder how you can advertise this as a good idea: You have to manually 
keep declarations in sync, you have to be very careful to get the 
attributes right, module constructor evaluation order guarantees don't 
hold, no mangling (no type safety), you pollute the C namespace, no 
inlining, no templates.

This is an established workaround at best, in no way it's a good solution.

-- 
Johannes


More information about the Digitalmars-d-announce mailing list