[Dlang-internal] druntime: proposed changes in code organization

Denis Feklushkin feklushkin.denis at gmail.com
Tue Nov 14 11:48:00 UTC 2023


On Tuesday, 14 November 2023 at 06:04:27 UTC, Iain Buclaw wrote:
> On Tuesday, 14 November 2023 at 00:33:34 UTC, Denis Feklushkin 
> wrote:
>> Hi!
>>
>> I propose to discuss a possibility of reorganizing code by 
>> this way:

Forgot to add to the potential benefits list:

Proposed approach eliminates tons of these identical lines:
```
version (AArch64) version = ARM_Any;
version (ARM)     version = ARM_Any;
[...]
version (X86)     version = X86_Any;
version (X86_64)  version = X86_Any;

version (OSX)
     version = Darwin;
else version (iOS)
     version = Darwin;
else version (TVOS)
     version = Darwin;
else version (WatchOS)
     version = Darwin;
```

> Be warned, this has a very long history and ulti ended up 
> nowhere.

Yes! And I suggested something similar too - 
https://forum.dlang.org/thread/rwmqulighwecqyxqbnkt@forum.dlang.org

This all suggests that something needs to be done with the 
existing approach. For example, for more than 10 years we haven't 
seen the expected creation of "lightweight druntime" for 
embedded. No one was able to solve such static branches puzzle 
gracefully.

By the way, proposed here "tags+directories" solution is the full 
equivalent of currently used "version branching"? (Can anyone 
refute this proposition?)



More information about the Dlang-internal mailing list