Deterministic Memory Management With Standard Library Progress

Moritz Maxeiner via Digitalmars-d digitalmars-d at puremagic.com
Sat Mar 4 17:41:47 PST 2017


On Sunday, 5 March 2017 at 00:58:44 UTC, Anthony wrote:
> [...]
>
> I've learned the basics of D. I read the tutorial book, as I 
> would call it, and some further tutorials on templates and 
> other cool things. I just don't feel comfortable investing a 
> significant effort acquainting myself further with the language 
> without some guarantee that the feature will be completely 
> supported eventually.

What do you consider complete support in this context? druntime, 
phobos, both? You can definitely write an application where all 
heap memory (after the druntime initialization) is allocated (and 
deallocated) deterministically, provided you don't use language 
builtins that require GC allocations (druntime) or stay away from 
other people's code that allocates using the GC (this includes 
those parts of phobos). std.experimental.allocator even provides 
a nice, generic interface for this (you'll want to use one of the 
allocators that aren't GCAllocator, though).
Considering D development is - AFAIK - not primarily driven by 
people paid for their work I doubt you'll get a guarantee on any 
future development, though.

>
> In a way, I'm picking a tool for my toolbelt, and C++ and D are 
> competing tools.

If possible, don't pick one, pick both (and to be even more 
annoying: also pick some Lisp, Erlang, Haskell, and Rust to get 
exposed to many different types of abstraction).

> D looks like C++ 2.0, but it's missing a critical function of 
> it as well. So, I'm conflicted.

If you're referring to deterministic memory management, it's not; 
the function is there, it's just up to you to actually use it and 
not invoke the GC.
If you're referring to not all of phobos' functions being 
compatible with deterministic memory management (as opposed to 
stdc++), then yes, that's an ongoing effort.




More information about the Digitalmars-d mailing list