druntime redesign
Denis Feklushkin
feklushkin.denis at gmail.com
Sun Mar 15 10:29:11 UTC 2020
On Tuesday, 25 February 2020 at 01:21:33 UTC, Denis Feklushkin
wrote:
> More specific proposal how to achieve this step by step:
> Сommunity may agree to add druntime module "core.sys.abstract"
> and everywhere in druntime code what references to a specific
> OSes and architecures (all these thousands of "version(){} else
> version(){}") will add also obtain code like
Probably I seem to know easiest way:
Many modules are scattered by version() keywords that implement
common calls necessary when using any platform.
For brief example look into: core/sync/event.d
We can improve Makefiles (and cmake in case of LDC fork of
druntime) to include only needed platform-dependend subdirs what
will contain these modules but without "versions", just code for
each supported platform.
(Do not confuse with core.sys.platform_name section!)
(And I couldn’t do it myself right now because I don’t know well
enough make and cmake systems. I am need "initial sample
template" to do things like in it.)
After such replacement it will be very easy to clear out
remaining libc calls (if it will be need - all supported
platforms actually have libc interfaces), and also support for
new arbitrary platforms will be ready - for supporting any new
platform will be enough to replace platform-specific section with
your own at build stage by build system.
What do you think about this? Is that good idea?
More information about the Digitalmars-d
mailing list