[squeak-dev] The Inbox: Collections-ul.564.mcz

Tobias Pape Das.Linux at gmx.de
Mon Feb 3 16:30:54 UTC 2014


On 03.02.2014, at 17:27, Frank Shearar <frank.shearar at gmail.com> wrote:

> On 3 February 2014 16:08, Tobias Pape <Das.Linux at gmx.de> wrote:
>> On 03.02.2014, at 16:14, Frank Shearar <frank.shearar at gmail.com> wrote:
>> 
>>> On 3 February 2014 15:06, Tobias Pape <Das.Linux at gmx.de> wrote:
>>>> On 03.02.2014, at 16:01, Frank Shearar <frank.shearar at gmail.com> wrote:
>>>> 
>>>>> On 3 February 2014 14:49, Tobias Pape <Das.Linux at gmx.de> wrote:
>>>>> 
>>>>> Except that DynamicVariable's #use:during: is incompatible with
>>>>> stack-slicing, because those kinds of dynamic variables aren't
>>>>> delimited. (Unlike resumable exceptions, for instance.
>>>> 
>>>> Sorry, I (currently) don’t know what you mean by stack-slicing.
>>>> Are we speaking of Martin von Löwis’ DynamicVariables currently in 4.5/trunk
>>>> that are based on Thread-local storage
>>>> or the Seaside ones based on Exceptions?
>>> 
>>> Ah! I thought that the Seaside ones were the same the DynamicVariable in trunk!
>> 
>> No; the trunk ones should be better, performance-wise, since they don’t
>> have to walk the stack on #value
> 
> Absolutely they're more efficient. O(1) lookup versus O(n) in the call
> stack. And they're also broken when considered with delimited
> continuations :) I haven't pushed hard on the issue because I don't
> know yet how to make them efficient. (Other languages do things like
> "shallow binding", in Henry Baker's terminology. We could possibly get
> the same thing with VM modifications.)
> 
>>>> (I just see that DV is using #value:during: rather than #use:during:
>>>> the former is consistent while the latter IMHO speaks better)
>>> 
>>> Right. So if Seaside's version uses resumable exceptions, there's no trouble.
>>> 
>>> By "stack-slicing" I mean tricks like using delimited continuations.
>>> Oleg Kiselyov demonstrated [1] how, since there are multiple
>>> reasonable ways of using delimited control and dynamic bindings
>>> (trunk's DynamicVariable) together, that there were therefore _no_
>>> reasonable ways of combining them. Dynamic bindings either capture too
>>> much or too little of the environment. The answer is to _delimit_ the
>>> dynamic bindings. Handily, that's exactly what we have with resumable
>>> exceptions + #on:do:.
>>> [1] http://www.cs.indiana.edu/~sabry/papers/delim-dyn-bind.pdf
>> 
>> Yes, but I think that is more of concern for continuations than for
>> dynamically scoped variables, no? Aren’t those by definition delimitted?
> 
> No, DynamicVariable style dynamic variables are not delimited, because
> their keep-the-old-value-around and their restore-old-value logic
> isn't on the call stack. But that's an implementation detail. The
> point of the referenced paper is that _no matter what_ implementation
> of dynamic variables you have, unless they're delimited they're broken
> when considered with delimited continuations. (Or delimited
> continuations are broken with them. Point is, their semantics cannot
> be sensibly combined.) And delimited continuations are baked into the
> bedrock of the language!

Ok, something that is earliest for 4.6 or even 4.7 :)

best
	-Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1665 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140203/9535f6a9/signature.pgp


More information about the Squeak-dev mailing list