Knitting as computation

K2G2 -- a wiki for "krafty knerds and geek girls" -- has a marvellous series of posts about "Computational Craft" through which traditional crafting practices, like knitting, are analyzed through the lens of computer science. The most recent post, A Computational Model of Knitting, point out the amazing parallels between knitting and computing, with knitting needles performing stack and dequeue operations, "While straight needles with caps store and retrieve their stitches according to the principle of LIFO (first in - last out), double pointed and circular needles additionally implement the functions of a queue or FIFO (first in – first out), effectively forming a double ended queue, also known as dequeue."

Garbage Collection

There even is an automatic garbage collection accounting for dropped stitches: once the number of superordinate stitches referencing a stitch drops to zero, the whole stitch is dropped altogether, meaning that it is replaced by the null stitch, which only contains references to is neighbors but not to any subordinate stitch. This garbage collection mechanism gives rise to typical avalanche effects, generally known as runs or ladders.

A Computational Model of Knitting (via Beyond the Beyond)

(Image: Learn to Knit, a Creative Commons Attribution (2.0) image from abbynormy's photostream)