[squeak-dev] Re: About String vs Symbols

Eliot Miranda eliot.miranda at gmail.com
Wed Jul 30 15:11:09 UTC 2008


On Wed, Jul 30, 2008 at 2:23 AM, Paolo Bonzini <bonzini at gnu.org> wrote:

> Eliot Miranda wrote:
>
>>
>>
>> On Tue, Jul 29, 2008 at 9:21 AM, stephane ducasse <
>> stephane.ducasse at free.fr <mailto:stephane.ducasse at free.fr>> wrote:
>>
>>    Hello
>>
>>    I'm reading newspeak spec and I like the idea of immutable strings.
>>    Now what does it really bring to us?
>>
>
> Eliot, I read your answer and (like Colin probably) I didn't understand if
> you were speaking about immutable objects in Smalltalk, or of immutable
> strings (as in Java, where you have immutable java.lang.String objects and
> use java.lang.StringBuffer to obtain a restricted kind of mutability).


So java strings are not really immutable but they don't provide a mutability
API?


> What family does newspeak fall in?


Its own :)  Gilad will be pushing this area beyond what Smalltalk offers.
 For example one idea is for the class of literals to be determined at
run-time depending on the instantiation of the module they're in.  So 'foo'
in a module Mx would, in an instantiation of Mx be an instance of ByteString
if the the instantiation imported ByteString as the literal string class,
and e.g. UTF8String in an instantiation that imported UTF8String as the
literal string class.  Obviously language semantics like this requires some
additional behind-the-scenes machinery.

I think I'm correct in saying that currently Newspeak is intending to use
Smalltalk-style immutable objects with per-object immutability enforced by
inst var assignment checks and the mutating primitives.  But this will be
extended to a notion of deep immutability where a sub-graph of objects
rooted at some immutable object will all be immutable.  This is to support
better actor-style concurrency.  But don't take it form me.  Post a question
on Gilad's blog, or google gbracha.blogspot.com for Immutability.

>
>
> Paolo
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080730/464a6824/attachment.htm


More information about the Squeak-dev mailing list