We already have this in our TODO list after beta, but I just created a dedicated issue: Reference counted pointers · Issue #5382 · lfortran/lfortran · GitHub.
Here are past relevant discussions and proposals:
- Reference counted pointer · Issue #334 · j3-fortran/fortran_proposals · GitHub
- Ownership for Fortran pointers
But I haven’t seen mentioned there that possibly the existing pointer
s in Fortran could be implemented like that. Definitely worth investigating!