Deterministic Memory Management With Standard Library Progress

Anthony via Digitalmars-d digitalmars-d at puremagic.com
Sat Mar 4 20:36:27 PST 2017


On Sunday, 5 March 2017 at 01:41:47 UTC, Moritz Maxeiner wrote:
> 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.

Not having it guaranteed is understandable, albeit slightly 
disappointing.

I would pick both, if I had the time to do so. I'm a college 
student; with that in mind, I can only really learn one right now 
without giving up most of my free time. I think it'd be stressful 
if I tried.

I was referring to phobos. I feel intimidated by the idea of 
trying to code some of the functions of phobos myself in a no-gc 
manner. I'm sure I'd run into things way out of my knowledge 
domain.


More information about the Digitalmars-d mailing list