Arc Forumnew | comments | leaders | submitlogin
1 point by shader 6001 days ago | link | parent

I suppose that choice (mutation vs. copying) depends on the relative performance / ease of coding. If you think that mutation is important, than you can sacrifice the efficiency of limited sharing. Alternatively, you can share and not mutate. Maybe you're implementation could leave that up to the user? Have directives for copy vs. share, and if sharing is permitted, than mutation is not, etc. Of course, that clutters the vocabulary and leads to extra typing.

Actually, I don't know which is worse performance wise: Code introspection to prohibit mutation, or copying. Alas, this problem gets complicated the more one moves away from simple absolutes like "no mutation" and "copy" to "immutable sometimes" and "copy mostly" :)



1 point by almkglor 6000 days ago | link

> Have directives for copy vs. share, and if sharing is permitted, than mutation is not, etc. Of course, that clutters the vocabulary and leads to extra typing.

Then User A writes Process A to use sharing and User B writes Process B to use copying. Process A sends object to Process B. ^^

-----