Skip to content

Future direction for memory management? #489

Open
@cmacmackin

Description

@cmacmackin

I was hoping to clarify what your long-term goal is for memory management. #150 suggests that you eventually want to add a =sink operator, but that seems to conflict with the idea of using reference semantics. You had toyed with moving away from that (#157) but ultimately decided against it.

Your current approach does seem to conflict with the idiomatic way of doing things in Nim and makes it difficult, verging on meaningless, to use sink/lent annotations with custom containing a Tensor. It would seem to me that the most idiomatic way to handle this in Nim would be to make Tensors use value semantics by default, using Nim's =destroy operator for destruction and =sink operator for optimisation. If a user then needs reference semantics then they can just use a ref Tensor type.

Of course, I fully appreciate that this would be a significant (and breaking) change, so I don't expect you to suddenly make it on account of this feature request. Still, I thought it was worth raising.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions