Memory is actually shared in Elixir until it's required to create new memory because of a change. So even if you have a big dictionary and something changes, part of the dictionary that remained the same will actually share memory until it's required to create new memory because of a change in that part of the dictionary.
So in effect, most immutable languages actually do copy by reference, it's just abstracted away for the programmer and you can reason about it as copy by value.
I can't find the article now but I remember reading about this and someone can probably link it.
So in effect, most immutable languages actually do copy by reference, it's just abstracted away for the programmer and you can reason about it as copy by value.
I can't find the article now but I remember reading about this and someone can probably link it.