Rant time? Rant time.

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Sep 22 10:00:46 UTC 2020


On Tuesday, 22 September 2020 at 09:47:44 UTC, IGotD- wrote:
> People who ask for required ownership often don't know what 
> they are asking for. If ownership (single of course) is 
> introduced, many data structures will no longer work. Right now 
> one of D's benefits is that many data structures just work out 
> of the box and even with GC.
>
> I want a sea of objects, single ownership is way too limiting.

I believe Microsoft has a research language where ownership is 
tied to a group of objects.

I actually think C++'s model works out ok, when you add custom 
allocators to the mix. But it would be better if the compiler 
could ellide allocations or simply avoid calling side-effect-free 
destructors if the entire (local) allocator pool was released. I 
also want compiler support for embedded refcounts (shared_ptr is 
costly).

There is no certain way to establish how memory is allocated and 
released in C++, so that does prevent (analytical) optimization 
opportunities.

The key challenge is really providing some mechanisms that makes 
memory management, initialization and finalization analytically 
tractable and providing more optimization opportunities.

(I think "provably memory safe" is too expensive in terms of 
development freedom and time, so ignore that aspect. "Safer" is 
good enough. "Safe" isn't really needed or realistic.)


More information about the Digitalmars-d mailing list