The code
Crochet, written like code. Checked like code.
Krowshea is a programming language for crochet. You write a pattern once, in crochet's own words, and Krowshea checks every stitch, then makes the chart and the written pattern from it. This is what it looks like.
swatch.krowKrowshea
STASH {
YARN oat = #D8C8A8 [ weight: 4 ]
}
LAYOUT Linear {
ROW 1 [COLOR: oat]: CH 8, TURN
ROW 2..5:
CH 1 TURNING
SC 8
TURN
}
Nothing new to learn
Your patterns are already code
Read a printed pattern closely and you'll find most of the parts of a program. Krowshea keeps crochet's words and gives the pattern a reader that checks it.
| In a printed pattern | In Krowshea | In programming |
|---|---|---|
| Ch 8, turn | CH 8, TURN | an instruction |
| Rows 2–5: sc in each st across | ROW 2..5: … SC 8 | the same steps for several rows |
| *v-st in next st; rep from * around | REPEAT AROUND: v IN NEXT | a loop |
| (12 dc) at the end of a round | EXPECT 12 DC | a check that the count came out right |
| V-st: (dc, ch 1, dc) in same st | STITCH v = (DC, CH 1, DC) | something you define once and reuse |
| For sizes M and L only: … | IF SIZE >= M: | a condition |
A whole pattern
Write it once. Get the rest.
The swatch above is a whole pattern: one yarn, a chain of 8, then four rows of single crochet. Krowshea checks it, writes it the way patterns are printed, and draws the chart. All three come from the same lines, so they always agree.
TerminalChecked
$ krow check swatch.krow
swatch.krow: ok (0 errors, 0 warnings)
Written pattern · US terms
- Row 1 (oat): Ch 8, turn. (8 ch)
- Rows 2–5: Ch 1 (does not count as a st), sc in each st across, turn. (8 sc)
Symbol chart
Before you pick up a hook
It finds the mistake and shows you the line
Krowshea keeps a ledger of every stitch: what each instruction works into, and what it makes for the next row. Here row 5 works 6 stitches into a row of 8. Nothing says how the row got narrower, so the edge would slope.
mistake.krowKrowshea
STASH {
YARN oat = #D8C8A8 [ weight: 4 ]
}
LAYOUT Linear {
ROW 1 [COLOR: oat]: CH 8, TURN
ROW 2..4:
CH 1 TURNING
SC 8
TURN
ROW 5: CH 1 TURNING, SC 6, TURN
}
TerminalError
$ krow check mistake.krow
error KRW4004: Row 5 has 6 stitches but row 4 has 8 (−2) and no explicit decrease is declared (e.g. SC2TOG)
--> mistake.krow:11:5
|
11 | ROW 5: CH 1 TURNING, SC 6, TURN
| ^^^^^^
= note: 2 stitch(es) at the end of row 4 never worked
mistake.krow: problems (1 errors, 0 warnings)
TerminalEvery error explained
$ krow explain KRW4004
KRW4004: Stitch count drops without an explicit decrease
An error, found while working every stitch
The row has fewer stitches than the row below, and nothing says how it got narrower. Your hook leaves stitches at the end unworked, so the edge would slope. In rows, the compiler holds the width steady unless the pattern says how it changes.
To put it right: Work every stitch of the row below, or say how the row narrows: a decrease (`SC2TOG`), a skip with a chain in its place, or a turn before the end on purpose.
…
Define once
Name a stitch, then use it anywhere
A V-stitch, a shell or a whole motif gets a name and a definition, and the written pattern explains it under Special stitches, just as a designer would.
define.krowKrowshea
STASH {
YARN sage = #9DB89A [ weight: 4 ]
}
STITCH v = (DC, CH 1, DC)
LAYOUT Round [ join: always ] {
ROUND 1 [COLOR: sage]: MAGIC RING, 12 DC IN RING
ROUND 2: REPEAT AROUND: v IN NEXT
ROUND 3: REPEAT AROUND: v IN NEXT SPACE, SC BETWEEN GROUPS
}
Written pattern · US terms
- SPECIAL STITCHES
- v: (dc, ch 1, dc) in the same place.
- In each round, make the first dc as ch 3: the beginning chain stands in for that dc.
- Round 1 (sage): Make a magic ring, 12 dc in ring, pull the ring tight, join with a sl st to the first st. (12 dc)
- Round 2: *v in next st; rep from * around, join with a sl st to the first st. (24 dc, 12 sps)
- Round 3: *v in next sp, sc in next sp between groups; rep from * around, join with a sl st to the first st. (24 dc, 12 sc, 12 sps)
Color view
Tell it how big
It works out the rounds, and tests the result
Say how big a piece should be and Krowshea works out how many rounds it takes and where the increases go, so the circle lies flat. A test writes down what the design must do, and it's checked every time the pattern changes.
to-size.krowKrowshea
STASH {
YARN coral = #EE6C4D [ weight: 4 ]
}
LET size = 13cm
LAYOUT Round [ join: always ] {
ROUND 1 [COLOR: coral]: MAGIC RING, 12 DC IN RING
ROUND 2..: GROW FLAT IN DC UNTIL size
}
TEST "coaster" {
EXPECT DIAMETER size ± 1cm
}
TerminalWorked out
$ krow check to-size.krow
info KRW4028: GROW FLAT makes rounds 2–4 (3 rounds), 12 → 48 stitches, about 13.3cm across
--> to-size.krow:9:16
|
9 | ROUND 2..: GROW FLAT IN DC UNTIL size
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
to-size.krow: ok (0 errors, 0 warnings)
TerminalTested
$ krow test to-size.krow
to-size.krow
✓ coaster
1 test in 1 file: 1 passed
Every size at once
One pattern, every size, all checked
Give each size its numbers. Krowshea checks every size and writes them together, the way graded patterns are printed.
sizes.krowKrowshea
SIZES S, M, L {
LET width = 20, 24, 28
}
STASH {
YARN main = #C8823A [ weight: 4 ]
}
LAYOUT Linear {
ROW 1 [COLOR: main]: CH width, TURN
ROW 2..40: CH 1 TURNING, SC IN EACH ACROSS, TURN, EXPECT width ST
}
Written pattern · US terms
SIZES: S (M, L)
- Row 1 (main): Ch 20 (24, 28), turn. (20 [24, 28] ch)
- Rows 2–40: Ch 1 (does not count as a st), sc in each st across, turn. (20 [24, 28] sc)
A real language
The tools programmers expect
Krowshea is a whole language, not a form to fill in, so it comes with the tools that make code pleasant to write.
krow check- Checks every stitch count, round by round and row by row, and points at the line.
krow write- The written pattern in US or UK terms, with materials, abbreviations and counts.
krow chart- Symbol charts with the Craft Yarn Council's standard symbols.
krow yarn- How much of each color, in meters, yards, grams and balls.
krow test- Runs a pattern's tests: its size, its yarn, that it lies flat.
krow explain- Every error has a number and a page that says how to put it right.
krow fmt- Lays the code out neatly, the same way every time.
- Packages
- Share stitches and motifs as packages. A package is only accepted if it compiles and its tests pass.
- Editor extension
- Colors, errors as you type, and what each round makes, at the end of its line.
No AI inside: every result on this page came from the compiler, and the same pattern gives the same answer every time. Krowshea is in development.
Krowshea is in development
Write your own patterns as code
Join the beta list to hear when you can try it. Or see more of what the code makes: a whole mandala and every stitch, step by step.
Join the beta