KnitScript

Scott Hudson is a researcher in Human Computer Interaction (HCI) from Carnegie Mellon University. His talk today covered several different areas of research, all of which can be viewed as tying in to Moore’s Law in some way. The last area of research which Hudson touched on involved “abstracting and encapsulating” specialist knowledge in 3D printing, to enable greater adoption of the technology. The paper which I’ll talk about here, KnitScript: A Domain-Specific Scripting Language for Advanced Machine Knitting, covers a similar line of thought; how to improve the usability of advanced features of knitting machines via a domain specific language (DSL).

Knitting machines are capable of generating novel and complicated structures in fabric. However, the existing high-level tools for designing knitting designs don’t allow users to take full advantage of the capabilities of the machines they’re using. There have been geometrical approaches, similar to FDM printers, where software is used to “slice” the knits. But these approaches have similar limitations to those of 3D slicers, and are incorporate difficult-to-learn approaches from other domains.

Hudson collaborated on developing KnitScript, which is a higher-level DSL for knitting machines. This scripting environment has two core parts — a virtual machine-model that captures the constraints of safe movements & the properties of safe knits, and a “knit graph” which represents the actual structure of the fabric.

Users interact with the model in their script to grow the knit graph, which is translatable to machine code. There are several types (Needles/Loops/Carriers/Yarn/Sheet/Carriage) provided for updating the state of the model.

In their paper, Hudson et al discuss several kinds of knits made via their DSL. They also provide some example activities which demonstrate the “expressiveness” of KnitScript, as measured via the lines of code (LoC) required for a weave, and the change in LoC to get a similar weave. The authors also conducted a usability study, which indicated that fairly short times are required by novice users of KnitScript to modify a script to produce different types of weaves. Currently, their script lacks some features of modern programming languages (such as debuggers), which they may tackle in future work.

Leave a Reply