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

Denis Feklushkin feklushkin.denis at gmail.com
Sat Dec 16 19:42:43 UTC 2023


On Saturday, 16 December 2023 at 18:59:50 UTC, Johan wrote:

>> Make sure what you read benefits list:
>> https://github.com/dlang/dmd/pull/15822#issue-1996484133
>
> Much of your list are not benefits, just removing things from 
> the source code that you find "ugly" I guess. For example, 
> removing `version (Linux):` is not a benefit; it's just 
> developer taste, with no benefit for the user.

This is actually one (little) benefit, because currently you 
cannot write a program for Windows that will use some druntime 
Linux structures for parsing something like net traffic, core 
dumps, etc. You will need to duplicate Linux (or Posix) 
structures for that.

This is a meaningless block that has formed historically because 
it was easier and faster to implement by this way

> I understand that for you currently the situation is not nice. 
> But it is not a good solution to make life good for you, and 
> make it worse for the status quo. A custom druntime or 
> non-standard OS is not a very common case.

(At first, I don't see what currently druntime is distributed as 
ready for cross-compilation bundle. I.e., ldc2 archieve isn't 
contains druntime binary for Windows, Linux and *BSDs 
simultaneously, right? In this case we should not change anything 
particularly much in the config)

As for me, we don't know common this case or not. "Non-standard 
OS" includes thousands variations of hardware+software from 
realtime embedded software to modern gaming consoles support or 
so on.

But it will be simpler to be always at second place (after 
invincible C and C++) on D support implementation timeline in the 
event of the appearance of some new (revolutionary, of course) 
devices or OS inventions. So I think I guess that the impact of 
such a changes will be great.

ldc2.conf will obtain 3-6 sections (i.e. about ~50 lines total) 
for common platforms like Linux, Windows and *BSD. Is that too 
expensive?




More information about the Dlang-internal mailing list