The D Language: A sweet-spot between Python and C
Rikki Cattermole via Digitalmars-d
digitalmars-d at puremagic.com
Sun Mar 29 21:35:37 PDT 2015
On 30/03/2015 5:25 p.m., Laeeth Isharc wrote:
> On Monday, 30 March 2015 at 04:16:38 UTC, weaselcat wrote:
>> On Monday, 30 March 2015 at 00:57:06 UTC, Walter Bright wrote:
>> a lot of the people in the thread are unaware that D even has RAII
>> like C++, and think it's just a GC language like java/etc. Maybe this
>> is something worth mentioning more on the introduction?
> Also, there is a perception that you can't use the standard library and
> nicer language features if you do your own allocation and don't depend
> on the GC. A guy worrying about hygiene problems mixing GC and Raii
> libraries. Whereas most garbage is small and fine to use GC for in some
> applications - only a subset of real time applications suffer from
> generating gazillions of tiny objects. It would be good to set out
> somewhere what you lose as regards std library by insisting on using
> nogc. The point about std.algorithm should be made more prominent.
I'm currently working on the forcing GC cleanup mechanism for my web
server. I would like to add, that post GC disabled it can be forced to
do a cleanup.
But I would go a step further, do a force minimize of memory back to the
OS and reserve e.g. 32mb. Really what would be nice is a, reserveMax
function that and anything else is free'd back to the OS.
The reserve, means that even if you are sloppy and end up using the GC
in critical code, it won't matter. The memory is already allocated.
Cleaning up can happen during non critical times. After all, if you are
using more then e.g. 32mb in critical code, you are doing something wrong.
More information about the Digitalmars-d