On Friday, 10 October 2014 at 21:54:32 UTC, Peter Alexander wrote:
(a) gives users full control over how every function allocates/manages memory (control).
(b) makes the implementation of those functions easy (simple).
(c) makes it easy to compose functions with different management policies (expressive).

Probably the method would be to make garbage management an aspect of the language itself, like how Go handles parallel processing at the compiler level. Developers write everything like it's all magically garbage collected, with maybe a few metatags/keywords sprinkled around, and then tells the compiler what the default garbage collection should be, and the garbage collector goes in and rewrites code according to different strategies, including an option for static-analysis based collection like Mercury.

D could potentially be moved that direction, but I would imagine that adding reference versions of structs would be necessary first, so that pointers became less prevalent, and pointers only allowed in blocks marked dangerous where the programmer has to perform any management himself.

Reply via email to