How high level is D?

Dukc ajieskola at gmail.com
Wed Nov 21 23:22:39 UTC 2018


On Wednesday, 21 November 2018 at 12:30:28 UTC, bmelo wrote:
> But D gives more access to hardware than Go? I listened about D 
> not going so weel to embedded and operating system programming 
> like C and C++ because GC. Is D's GC more able to give you 
> hardware control than Go's GC?

More machine-contorl than Go? Easily. Go's GC cannot be dropped, 
or so I've been told. In D, you can program even if the GC hasn't 
been implemented for your platform at all. The whole C standard 
library and large parts of Phobos are still in use, and you can 
still manage memory by RAII 
(Resource-Acquisition-Is-Initialization) idiom or by reference 
counting.

You are still miles ahead of using C, and not necessarily worse 
off than with C++ either. Many third-party D libraries won't work 
without GC, but you can still use all C libraries and some C++ 
libraries (Can somebody tell what are the changes of C++ interop 
working in practice? No personal experience) from D.

But what you need to consider for embedded targets is that unlike 
C/C++, D excepts at least 32-bit architechture by design. If one 
wants to program devices smaller than that, something else is 
needed.


More information about the Digitalmars-d mailing list