Live data from Hacker News

Knotty: A domain-specific language for knitting patterns

t0mpr1c3.github.io

41–50 of 57 posts

Re: Knotty: A domain-specific language for knitting patterns

#41
Most interesting aspects (Notation+DSL) here:

Physical Reality as Type System

- Knitting notation treats physical constraints (yarn direction, needle capacity) as compile-time invariants, not runtime checks

- The notation literally cannot express impossible operations - unlike most programming languages where invalid states are runtime errors

Semantic 2D Syntax

- Spatial positioning encodes operational meaning, not just formatting

- Chart coordinates directly map to fabric coordinates - position IS semantics

- Most programming languages waste the 2D plane on purely aesthetic layout

Context-Dependency That Works

- Heavy context-switching (RS/WS, cable positions) remains manageable because contexts map to physical realities practitioners can feel

- Suggests context-dependent syntax works when contexts correspond to user’s embodied experience

- Contradicts typical CS wisdom that context-dependency is always bad design

Expert Chunking Over Beginner Clarity

- Single symbols encode 4+ sequential operations for expert efficiency

- Notation evolved to optimize pattern recognition for power users, not learning curves

- Inverse of typical programming language priorities (readability over expert speed)

Domain Invariants Enable Multi-Modal Translation

- Knotty’s translation capabilities required modeling yarn physics, not just syntax

- The type system encodes gauge, tension, and material properties as first-class constraints

- Shows DSL success requires modeling domain physics, not just domain vocabulary

Power-Law Feature Adoption

- 10 symbols for basics, 200+ for experts - mirrors programming language feature creep

- But knitting notation maintained backwards compatibility across complexity levels

- Suggests sustainable complexity growth patterns for language design

Re: Knotty: A domain-specific language for knitting patterns

#43
post #18

Earlier quoted context omitted.

From a computer-science theoretic view, any any recursively enumerable transform is computing. It's pretty easy to see the translation between a Jaquard loom and an abstract Turing machine. Just because it smells of machine oil and lanolin instead of ozone and magic smoke doesn't mean an automated loom and a modern computer are not essentially the same device, mathematically speaking.

> Just because it smells of machine oil and lanolin instead of ozone and magic smoke The magic smoke I've smelled before specially with a burnt cap but do computers really smell of ozone???

When I was younger I worked with a lot of prototype devices. The lab always had the smell of rosin core and ozone and, from time to time, something worse that resulted in the requirement for a new board. And once, a new desk.

So I guess the answer is "it depends".

Re: Knotty: A domain-specific language for knitting patterns

#44
post #31
post #28

Earlier quoted context omitted.

What I remember from school (late 90s) is that Babbage was inspired by Jacquard’s punched cards to use then in his Engine, and either this, or Jacquard directly, inspired the same in Hollerith. I don’t recall it as there being a direct line in terms of “modified loom is general purpose computer) but it was certainly an important influence. In hindsight it seems easy for some of us to make the connection, but, at the…

I'm not disputing the influence of jacquard machines in general, but there is big difference between "having influence on computing" and "is a computer".

It's not just a computer, it's a stored program computer.

What it's not is a general purpose computer.

Re: Knotty: A domain-specific language for knitting patterns

#45
post #10

Some say the Jacquard machine was the first real computer using punched cards https://en.wikipedia.org/wiki/Jacquard_machine

"Punched cards" tickles me, like "cheesed burger".

lol you are right but cheesed burger made me think about those burgers fully dunked into cheese sauce

Re: Knotty: A domain-specific language for knitting patterns

#48

This is great, but it’s entirely disqualifying that it isn’t called Purl.

as always the actual gems are in HN comments :D

knotty should be some kind of protocol for getting a tty on a knitting machine.

Re: Knotty: A domain-specific language for knitting patterns

#49

You have to admire the full-circle of history about this. Arguably, the first stored programs were created in the 1820s to automate Jacquard looms. The looms used a series of punch cards to automate the weaving of complex patterns. The system helped inspire Charles Babbage's Analytical Engine. Now 200 years later, we get Knotty. Very satisfying, in a holistic interconnectedness sort of way.

As a knitter, I feel compelled to point out that weaving and knitting are very different ways to create textiles. (And crochet is even more different, which is why there are currently no machines that can crochet.)

Re: Knotty: A domain-specific language for knitting patterns

#50

A quick googling says that lego knitting machines have been built. Now it's just to program them! https://www.youtube.com/watch?v=MV19wqtfyF0 Is it only a matter of time before you can get generative AI to create a pattern based on a prompt and then some service mails gift wraps and mails it to you/friend (along with video of the lego machine making it)? Just in time for the holiday season :D Added: there are lots of…

I've been curious about knitting & crochet from a programming / robotics / simulation perspective for a while, but deferred it to cut my teeth on simpler problems. Those industrial robots seems to be knitting, not crocheting. They use the term "crochet knitting" as a sales tactic.

This short video is annoying but informative: [1]

The closest I've seen to actual robotic crochet is [2].

Which is exciting and close - but it's hard to overstate its limitations. I took the challenge in that short video seriously and spent 10-20 hours learning basic crochet. It became very clear that replicating my simple test patterns would require vision, planning and modeling capabilities beyond anything I've seen in SOTA surgical robots.

What I find interesting about the post (Knotty) is buried here [3] - apparently it's possible to ditch the grid and create an intuitive representation of the final knit pattern. I suspect that may be doable using traditional algorithms.

[1] https://www.youtube.com/watch?v=EImnSsCadK8

[2] https://www.youtube.com/watch?v=T1-pfeaVsOM

[3] https://stitch-maps.com/about/overview/

Post reply on HN