functional
Walter Bright
newshound1 at digitalmars.com
Wed Mar 10 18:10:59 PST 2010
grauzone wrote:
> Walter Bright wrote:
>> grauzone wrote:
>>> Data this small you would simply copy. Because it's so small, copying
>>> won't have negative performance impact. The OS approach can be used
>>> for large data (at least in the order of hundreds of KB) and
>>> immutable parts of the data segment.
>>
>> You'd also have to transitively copy everything referenced.
>
> If that becomes a problem depends entirely from how the message passing
> API (or whatever) is used*.
If there's anything I've learned about language design, it's that if
there is a capability, it will be used, and if there's a major problem
with it, that will generate major complaints.
The fact is, people *do* have major problems with concurrent
programming. Sharing of mutable state is a large generator of these
problems, and I don't think we can wish it away or blame the programmer.
What transitive immutability offers is a guarantee. As programs become
ever larger and more complicated, relying on individual programmer
diligence and uncheckable conventions is less and less acceptable.
For example, we're at the stage now where mainstream languages offer
guarantees against buffer overflows. This is a huge win - just witness
the $$$$$ the C shops spend on Coverity to desperately try and squeeze
them out of their code.
More information about the Digitalmars-d
mailing list