D with minimal runtime

IGotD- nise at nise.com
Mon Jun 15 10:01:06 UTC 2020


On Monday, 15 June 2020 at 08:54:45 UTC, Dibyendu Majumdar wrote:
> Hi,
>
> When writing compiler tools, a GC seems desirable as managing 
> memory for the data structures used by compilers is a pain. I 
> guess the better C option has no runtime, whereas normal D has 
> the runtime with GC. I was wondering whether the runtime can be 
> minimized to only support the GC. Or is that already the case, 
> i.e. the D runtime is already the minimum needed for GC?
>
> Thanks and Regards
> Dibyendu

C does almost require a standard library which is clib. You can't 
do memcpy or memset without clib so C becomes kind of dependable 
on clib. However, you can use C without clib as well and D can 
that too with the -betterC switch.

I'm looking for a minimal druntime too. Right now it is all or 
nothing for druntime and it expect a full rich OS. There have 
been talks to partion druntime better so that you can incremental 
support, for example leave networking out if you want to. Also 
right now for all operating systems, druntime depends on clib 
itself. Nim has a compiler switch -os:any which means that the 
runtime will only depend on clib which makes it very portable. 
That would have been nice in druntime too.


More information about the Digitalmars-d mailing list