[Dlang-internal] druntime: proposed changes in code organization
IGotD-
nise at nise.com
Fri Dec 1 12:53:55 UTC 2023
On Friday, 1 December 2023 at 05:29:31 UTC, Denis Feklushkin
wrote:
>
>> First, I think that you need to more precisely explain what a
>> "tag" is.
>
> Okay, I'll write here and when everything is discussed I’ll add
> it to the PR description
>
>> What is the underlying data type and how does it differ from a
>> version identifier. I don't understand what a tag is by
>> reading the PR.
>
> Proposed tags are similar to a D's versions, but I decided to
> separate its name because tags become not corresponding to a
> built-in D versions, at least.
>
> For example, most likely, tags with names like
> “posix_compatible_threads” will appear, because in the future
> we will understand that some OSes use Posix interace API to
> provide threads functionality but while not being a Posix
> system. The same goes for working with files, etc.
>
> I also suggest to write sets of tags for each target in this
> form:
> ```
> x86_64,posix,osx
> ```
> and not in:
> ```
> x86_64-posix-osx
> ```
> to prevent attempts to combine proposed druntime tags with
> compiler target triplets
Thank you, now I have a better understanding what a tag is.
Correct me if I'm wrong so these tags are like "feature defines"
similarly to a boatload of C defines that you must define for
certain C-libraries. Will these tags eventually become version
identifiers inside the code? Also one question if the tags are
visible inside the D code or just outside the code in the build
system?
>
>> The PR doesn't mention anything about the generic part of the
>> implementation. Where should the generic part be?
>
> I don’t understand what is meant by "generic part" here
>
We have OS/API specific code in druntime but also generic code
that can be shared by all OSes. What I was looking for is an
explanation where this generic code should located. Will it be
like it is right now and you break out the OS specific code and
put it in druntime/config/? For example we can make the code in
druntime/src/core/thread/osthread.d (which is absolutely
horrible) and start to define what is OS independent, leave it
inside osthread.d and then put OS dependent stuff in the new
files?
More information about the Dlang-internal
mailing list