[Swift-user] Re: [Swift-devel] Problem with iterate

Ioan Raicu iraicu at eecs.northwestern.edu
Thu Feb 18 17:10:35 CST 2010


But I don't get it, how can the variable b not have a value, if it is 
consumed by cat() in a prior statement? I thought Swift followed a 
write-once read many paradigm, which was enforced by the single 
assignment paradigm. Perhaps it doesn't, and it was just my naive 
interpretation. I guess there is a distinction between files and 
variables? The single assignment only relates to variables, and not 
files? I am a bit confused I think, but I am sure it will all become 
clear, with a bit more explanation from you about how the single 
assignment fits into SwiftScript.

Ioan

-- 
=================================================================
Ioan Raicu, Ph.D.
NSF/CRA Computing Innovation Fellow
=================================================================
Center for Ultra-scale Computing and Information Security (CUCIS)
Department of Electrical Engineering and Computer Science
Northwestern University
2145 Sheridan Rd, Tech M384 
Evanston, IL 60208-3118
=================================================================
Cel:   1-847-722-0876
Tel:   1-847-491-8163
Email: iraicu at eecs.northwestern.edu
Web:   http://www.eecs.northwestern.edu/~iraicu/
       https://wiki.cucis.eecs.northwestern.edu/
=================================================================
=================================================================




Mihael Hategan wrote:
> There is no existing value of b.
>
> Here's the full example, which you can try out:
>
> app (file y) cat(file x) {
> 	cat @x stdout=@y;
> }
>
> type file;
>
> file a;
> file b;
>
> a = cat(b);
> b = cat(a);
>
> On Thu, 2010-02-18 at 16:17 -0600, Ioan Raicu wrote:
>   
>> But wouldn't the single assignment part prevent your example from
>> dead-locking? In other words, the compiler should throw an error on
>> line "b = cat(a)" as its trying to modify an existing value b.
>>
>> Mihael Hategan wrote: 
>>     
>>> On Thu, 2010-02-18 at 17:08 +0000, Ben Clifford wrote: 
>>>   
>>>       
>>>>> I'm unsure. I have a feeling that static dealdock detection is
>>>>> undecidable in swift. I need to think some more about that.
>>>>>       
>>>>>           
>>>> I think doing it statically (i.e. at compile time) is equivalent to 
>>>> executing the code (including external apps) - I think there's probably a 
>>>> straightforward example where something depends on an integer read from an 
>>>> externally executed app which then influences an if statement that decides 
>>>> which of two different arrays is being written to; or something like that.
>>>>     
>>>>         
>>> Right. So termination is undecidable by virtue of it being a turing
>>> complete language. What I'm unsure is whether deadlocks follow as a
>>> consequence of that. They are a different beast.
>>>
>>> We can probably start with simpler things. The following deadlocks with
>>> the current swift:
>>> a = cat(b);
>>> b = cat(a);
>>>
>>> So it seems that loops in the graph will create a deadlock and detecting
>>> loops requires knowing the graph. We can probably detect the static
>>> parts and we may be able to handle alternatives by issuing warnings of
>>> the "branch 1 in that 'if' combined with branch 2 in that other 'if'
>>> leads to a deadlock" sort.
>>>
>>> Arrays may be a bit tougher.
>>>
>>>
>>> _______________________________________________
>>> Swift-devel mailing list
>>> Swift-devel at ci.uchicago.edu
>>> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
>>>
>>>   
>>>       
>> -- 
>> =================================================================
>> Ioan Raicu, Ph.D.
>> NSF/CRA Computing Innovation Fellow
>> =================================================================
>> Center for Ultra-scale Computing and Information Security (CUCIS)
>> Department of Electrical Engineering and Computer Science
>> Northwestern University
>> 2145 Sheridan Rd, Tech M384 
>> Evanston, IL 60208-3118
>> =================================================================
>> Cel:   1-847-722-0876
>> Tel:   1-847-491-8163
>> Email: iraicu at eecs.northwestern.edu
>> Web:   http://www.eecs.northwestern.edu/~iraicu/
>>        https://wiki.cucis.eecs.northwestern.edu/
>> =================================================================
>> =================================================================
>>
>>     



More information about the Swift-user mailing list