Linda tuple space

4th October 2021 at 9:45am
parallel programming tuple

Carriero - Linda in Context.pdf (by Nicholas Carriero and David Gelernter) found from a tweet by Bret Victor:

indeed, very much inspired by Linda's tuple spaces, with two less-old ideas: tuples as complete sentences (inspired by Inform 7 and @alexwarth ) and tuples located in real physical space (inspired by handwork, Tufte, reality). Both super-important!

Linda is a model of parallel programming where processes write and read from a tuple-space. Linda has four basic operations: eval and out to create new data objects, and in and rd to remove and read them respectively.

For example:

out("a string", 15.01, 17, "another string")

// and to read (find) this tuple
rd("a string", ? i, ? j, "another string")

// how to calculate the fibonacci sequence
fib(i) { 
  rd("fib", i - 1, ? prev)
  rd("fib", i - 2, ? prevprev)
  out("fib", i, prev + prevprev) 
}

// out("fib", index, value)
out("fib", 0, 0)
out("fib", 1, 1)
for (i = 2; i < 10; i++) {
  // eval will create a new process
  eval(fib(i))
}

// to store a vector V of n-element
out("V", 1, FirstElement)
out("V", 2, SecondElement)
...
out("V", n, NthElement)

// to change the ith element of the vector
// we first remove it from the tuple space
in("V", i, ? OldValue)
// and then put the new value back
out("V", i, NewValue)

I don't know much about parallel programming but it seems interesting. I should check how Go and Clojure are doing it.

Possibly interesting references

Related to


Backlinks: A Guide for the Perplexed by Joe Armstrong, About this page, Daily Note - 25/09/2021, Daily Note - 28/09/2021, FoundationDB by Apple, How to increment a variable using Linda tuple space, Inform natural-language-based programming language, Joe Armstrong & Alan Kay, My first impressions on Linda, Semantic MediaWiki is a free form database