DMD as cross-compiler
pjmlp at progtools.org
Sun Nov 15 07:51:52 UTC 2020
On Sunday, 15 November 2020 at 07:21:28 UTC, Denis Feklushkin
> Really, libc is not (only) C library, but de-facto standard for
> accessing to OS syscalls. It is possible to drop it but it
> doesn't make any sense, it just adds extra work to maintain a
> huge compatibility layer for all supported OSes.
> I once thought differently, but recently delved deeper into
> druntime and looked how it works. In total, I think, there are
> about ~15 calls to libc, not so many.
Only for the OSes where C was born on, UNIX and POSIX clones.
There are still several platforms around where this is not the
case, because their main systems programming language isn't C,
e.g. IBM and Unisys mainframes.
Embedded platforms that use their own toolchains without any kind
of POSIX compatibility.
And desktop OSes like Windows, which follows the tradition of C
and C++ compilers outside the UNIX world, where each compiler
vendor ships their own ISO compliant library, and the OS syscalls
are completly unrelated, e.g. ZeroMemory() instead of memset().
Amiga, Atari, OS/2, BeOS, Symbian, Brew, Mac OS pre OS X, Newton,
PalmOS, are all examples of this tradition.
More information about the Digitalmars-d