D programming language popularity

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sun Nov 8 17:50:41 UTC 2020


On Sunday, 8 November 2020 at 17:00:07 UTC, IGotD- wrote:
> No, then you put restrictions on raw pointers which is 
> something we don't need. Forced single ownership is something 
> that does not belong in D. Let's just keep the raw pointers as 
> they are and add other pointer types instead.

That is what I would do too, but then you can use a library. And 
it breaks all existing GC based libraries with no help from the 
type checker when porting.

You cannot convert GC code this way, to do that you have to make 
current pointer types owning and introduce a new nonowning type.

> This is something not many languages has thought of which is 
> generic pointer types, the ability to mix pointer types in a 
> program that are not pre-determined. C++ has its unique_ptr and 
> shared_ptr but I was think more in line with A_ptr or B_ptr and 
> what those pointers are supposed to use is configurable. This 
> is of course possible as library additions but I've never seen 
> languages to offer this out of the box and it would be nice to 
> have a language framework for this.

I have suggested it before in the forums. In C++ you can template 
the smart pointer type, I think. Although manual borrowing is the 
common way...


More information about the Digitalmars-d mailing list