Fear and loathing of the "perlification" of Smalltalk

Michael van der Gulik mikevdg at gmail.com
Wed Sep 5 22:45:16 UTC 2007


On 9/5/07, Peter William Lount <peter at smalltalk.org> wrote:
>
>
> A special category of exceptions to library only extensions exist that
> enable the opening of a new dimension of capability. For example, blocks
> enable anyone to create new control flow structures in Smalltalk. It's
> still surprising how people are continuously innovating in with methods
> for blocks and unique ways of using them. I look for opportunities to
> enhance a language syntax that create these new dimensions. I see the
> gap of possibilities and a few innovative ways of using it but it's how
> big the gap is that's key.
>
> The curly braces don't create a new dimension of possibility beyond the
> few uses since the the curly braces are not extensible in the class
> libraries.


I just thought up an alternative to curly braces that doesn't change the
compiler. I chose an unused operator and implemented it so that:

'hello' ++ 'world' ++ 1
returns an OrderedCollection('hello' 'world' 1) "actual result from my
3.10image"

You could do the same with a list of Associations to make a Dictionary. If
it is slow, then you could modify the Compiler to optimise for this
operator, but it wouldn't need changes to the syntax of the language.

However, the block version of continuously collecting
> statement evaluations does enable a new dimension.  I don't know all the
> uses. But already in this discussion someone found one, by adding a
> third evaluator for concurrency purposes. That's not just another use
> but an entire other dimension found! Now to implement them and extend
> the power of blocks into the future.


For your specific example of concurrency, I'd much rather do something like
this:

(    [ s1 doSomething ]
     ++ [s2 doSomething]
     ++ [s3 doSomething]
) doConcurrently.

(aka: implement OrderedCollection>>doConcurrently)

This pattern might have implementation possibilities such as waiting until
all processes have finished before continuing, or using a set of worker
threads rather than making new threads.

What I'd really like to see is a concurrent Collection of some sort, where
methods such as do: have multi-threaded implementations.


Other languages are catching up and surpassing Smalltalk - we need to
> keep up and jet to the future.
>

Have you seen Java recently? I'd hardly call the latest language changes
"progress".

IMO what Smalltalk / Squeak really needs to be competitive in the future is
the ability to make full use of the latest batch of multi-cored processors.
This can be done using libraries and VM modifications rather than changing
the language.

Michael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070906/5098e0c4/attachment.htm


More information about the Squeak-dev mailing list