Escaping the Tyranny of the GC: std.rcstring, first blood

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 28 03:46:44 PDT 2014


Am 28.09.2014 12:15, schrieb Marco Leise:
> Am Thu, 25 Sep 2014 01:27:13 -0700
> schrieb Walter Bright <newshound2 at digitalmars.com>:
>
>> On 9/25/2014 12:10 AM, Manu via Digitalmars-d wrote:
>>>   > I think Microsoft's C++/CLI tried that mixed pointer approach, and it was a
>>> disaster. I don't have personal knowledge of this.
>>> C++ doesn't have any notion of borrowing. Scope can (will?) fix a whole lot of
>>> existing problems, and also allow RC -> raw pointers work nicely.
>>
>> Consider that people complain a lot about annotations. See the other thread.
>> Adding the scope annotations everywhere is a LOT of annotations. Do you think
>> people will be happy with that? I don't.
>>
>> I remember reading a paper about someone adding pointer annotations to Java. It
>> was a technical success, and a usability failure. People just couldn't be
>> bothered to add the annotations.
>
> You brought up these comparisons with near/far pointer earlier.
> (They stay as vague.) And now you also argue against borrowing.
>
> Please reconsider, since pointers do differ in their lifetimes.
> We have that friction already and D is unable to plug the hole.
>  From the top of my head there are several bugs about escaping
> stack pointers and RC is around the corner.
>
> The extent of what borrowing solves is really yaw dropping
> when you read the list of use cases and I will surely add
> scope to every function argument that it applies to (and
> already do that), because it makes it verifiable safe to call
> with any pointer type, be it ARC, GC or stack. I consider that
> more important than const or pure.
>
> And why do you bring up Java? Does Java have any pointer types
> other than GC? Is it a low level systems programming language?
> No! So those annotations probably weren't an enabling feature
> like "scope", right?
>

Depends on how you look at it.

Those type of annotations are used in meta-circular implementations of 
Java. In those cases Java is a low level systems programming language.

Case in point,

Jikes, http://jikesrvm.org/

Annotations examples, 
http://jikesrvm.sourceforge.net/apidocs/latest/org/vmmagic/pragma/package-summary.html

Oracle's Hotspot replacement Graal and Substrate VM AOT compiler,
http://lafo.ssw.uni-linz.ac.at/papers/2014_CGO_OneVMToRuleThemAll.pdf

--
PAulo


More information about the Digitalmars-d mailing list