A killer feature: copy-on-write #copyFrom:to:

Tagged:  •    •  

A killer feature that I would like to add is copy-on-write string handling. For a good example, see this post on ruby-talk (aka comp.lang.ruby):

When you take a substring in Ruby, it doesn't copy the string data. Instead, it just constructs a new string object (just a few words of memory) that references into the original string. Only when either string is modified does the string content get copied.

This is an extremely good idea (of course you would need some thresholding etc., but the point is clear). I'm not sure we can implement it efficiently in 100% Smalltalk (it is of course possible to implement it in Smalltalk, but it must be done really well).

Hi Paolo,
this sounds pretty a good example on how Smalltalk could be very flexible and innovative.
Once you get this to be a good choice for both scalability and performance, i would propose to insert it in the Smalltalk standard draft.

Thoughts about computer technologies - http://lethalman.blogspot.com
Smalltalk YX - http://syx.googlecode.com

User login