druntime redesign
IGotD-
nise at nise.com
Sat May 2 20:24:46 UTC 2020
Trying to adapt druntime has been a cascade of version (this) {}
else version (that). druntime and phobos is a ball of wool.
After porting druntime I realized that I need Phobos as well
because there is a lot of simple stuff like converting int to
string and so on. Converting an int to string doesn't rely on an
operating system. However, I'm forced to go through this version
cascade over again which is even bigger that druntime.
The situation is similar to the C library which also might have
dependencies all over. Some C library implementations are more
simple and OS support can be stubbed. What D needs is a stubbed
ABI for druntime/phobos. This means no file support, no threading
etc. This ties into the "pay as you go" goal of D. D should be
able to compile with minimal OS support instead of now require a
rich OS.
What we need is an ABI. Then we also need a stubbed
implementation of the ABI. This gives any implementer a good
overview what needs to be implemented as well as that the OS
support can be done incrementally. Some OSes don't support
everything like memory mapped files and we should support this
possibility as well.
We should also try to isolate the OS independent functionality
more. Convenience functions that doesn't need an OS should be
broken out, or at least with switches be compiled isolated from
the OS dependent code.
If we are able to do this, D will make a rocket career in
embedded systems.
More information about the Digitalmars-d
mailing list