Skip to content

fixes #20015; document shallowCopy does a deep copy with ARC/ORC#20025

Merged
ringabout merged 1 commit into
develfrom
pr_doc_shallowcopy
Jul 14, 2022
Merged

fixes #20015; document shallowCopy does a deep copy with ARC/ORC#20025
ringabout merged 1 commit into
develfrom
pr_doc_shallowcopy

Conversation

@ringabout
Copy link
Copy Markdown
Member

@ringabout ringabout commented Jul 14, 2022

fixes #20015

image

@Araq Araq added the merge_when_passes_CI mergeable once green label Jul 14, 2022
@ringabout ringabout merged commit 10c8e20 into devel Jul 14, 2022
@ringabout ringabout deleted the pr_doc_shallowcopy branch July 14, 2022 10:42
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 10c8e20

Hint: mm: orc; threads: on; opt: speed; options: -d:release
163320 lines; 14.970s; 838.762MiB peakmem

@arnetheduck
Copy link
Copy Markdown
Contributor

arnetheduck commented Jul 16, 2022

@Araq is this the long-term plan, that shallowCopy is broken from ARC/ORC? ie this is a significant semantic change - if it is the case, it should really be deprecated / removed-when-arc instead - these bugs will be incredibly hard to find

@Araq
Copy link
Copy Markdown
Member

Araq commented Jul 16, 2022

Yes, you're right. We should simply remove it from system.nim for --mm:orc.

(You're supposed to use x = move y instead if the compiler does not know a move is valid.)

@arnetheduck
Copy link
Copy Markdown
Contributor

(You're supposed to use x = move y instead if the compiler does not know a move is valid.)

this is semantically different: a shallow copy allows (mutable) aliasing (in an unhealthy way, I'd argue, but this is a different story) - so the two are not .. equivalent - that said, good riddance.

@Araq
Copy link
Copy Markdown
Member

Araq commented Jul 16, 2022

I know it's semantically different, else we would implement shallowCopy as move... But often it can be used instead.

@ringabout ringabout mentioned this pull request Jul 29, 2022
1 task
FedericoCeratto pushed a commit to FedericoCeratto/Nim that referenced this pull request Jul 30, 2022
capocasa pushed a commit to capocasa/Nim that referenced this pull request Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge_when_passes_CI mergeable once green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shallowcopy string doesn't work with arc/orc

3 participants