Skip to main content

Hi I'm a software developer, looking to write a 3rd party compiler for Knitcode



  • mark

    Hi Michael,

    I have similar thoughts about breaking my machine. :)  

    One path would be to evaluate "Knitout":

    to see if there assumption builtin that are incompatable with Kniterate's kcode.  Of course some of the assumption could be built in upstream in various CMU code that generates the knitout that think the target knitting machines can do things beyond the abilites of the Kniterate.  Hopefully such things are paramaterized, but it might not be the case.

    Note: strict adherance to community rule prevent us from asking each other email address or self promoting by providing links to our websites, or even providing our last names in a post.

  • Robert Ingemarsson


    I am sure there are few people wanting to do this and I have already started work on looking at both knitout and autoknit, and also developing my own templating software so I can template my own designs together..

    The knitout work seems a good place to start and its not hard to translate into delivering kCode from that.

    We have already WIFI enabled our kniterate machine so all it needs is a human to thread and reset the machine and press the start button ...


  • mark

    Interested to know, before diving into it head first without looking, to what extent Knitout -> kCode is already being worked at CMU

    Research Assistant - Robotics Institute-2015646

    Core responsibilities will include:

    Develop examples and documentation specifically tailored to owners of Kniterate and other prosumer-level knitting machines, a new class of users who may benefit from the knitout language and CAD tools.

  • Michael Sachen


    Very Interesting. I didnt see this posting

    I am actually supposed to meet one of their research assistants in the next few weeks and would be happy to ask about it.

    Im sure we can figure out a way to get in touch...

    Is there opinions on the existing knitout code base? I am considering writing an updated version in java to hopefully generalize what is already there for more types of stitches, and the ability to apply different stitches across objects. I have not been able to find information on what Kniterate does for takedown though, which has been one of my major concerns in approaching the project

  • mark

    not really looked into knitout code at any depth, so no opinion about it.  Personally I would shy away from updating as appose to working with as-is.  But you seem to be in communcations with CMU follks, so much more like to know their plans or have ways of finding out, my ignorance of their plans being the secondary reason I would not head down the update path.  (The primary reason is that I'm old, lazy, and lack the passion for coding that once burned inside me)

    Don't have a machine yet, and haven't really been playing with the kcode as some here. Take that as a warning that I'm likely incorrect, at least somewhat, in what follows regarding takedown.

    First, the 2 BIG warnings in every kcode file:

    // this format will be deprecated soon

    Kniterate has takedown rollers adjustable in both directions on each row (from their description of matchine).  The design app has means to adust 5 elements of a row, one being "roll" or "rollDuring".   If one does nothing a knit row appears in the kcode as

    << Kn-Kn 0 300 0 0

    if one adjust rollDuring to 1 the kcode changes to

    << Kn-Kn 0 300 1 0

    other parameter that might come into play

    (frontStichSize, backStichSize)  not sure if those are purely tension

    Template > Stitch Settings > rows/10cm;  not sure how that is factored into kcode, my changes didn't seem to change kcode, just display length v. width of knit work in design app

    shifting gear from kcode to Knitout,

    Knitout appear to expect one to define extensions to deal with the variety of takedown systems in the wild, so perhaps a exiting extension to use a model, or freedom invent your own syntax

  • D3VUR

    I was also curios if anyone have solid webdev people to help Kniterate team on their current software that everyone is using, I'm pretty sure they can use any help they can get now being slammed with biz operations/orders/troubleshooting/development/updates etc


  • Robert Ingemarsson

    Hi. I am sure there are plenty of people out there willing to help. We are part of the QA process and have offered to help with the development teams of the would like as i work as an IT consultant architecting, designing and delivering delivering complex IT solutions. I am sure they will reach out if people offer as it would be great to see the software take off :)

  • mark

    I've been writing programs since Mythical Man Month was first published, so I have to respond to a call to arms with the caution from Fred Brook: "adding manpower to a late software project makes it later"

    Yes it's an oversimplification, but it also points the the experience of many, that more people doesn't equal faster development.

    If one is in a situation where one can work under their guidence and direction, great.

    There are also things that we can do more or less independently as as "User Group" that are also helpful.  So far we've seen great evidence of it here sharing experiences with one another in real time, and building a great community. 

    On thing beyond the real time that we can do is start providing an organizational structure to the shared information in a dimension other than time.   As software and hardware changes, awesome workarounds become frustrating rabbit holes of wasted time.  I'm sure I'm not the only one that has searched for a solution on the internet, tried to follow the advice in some forum thread, only to discover it is 10 years old and for old version of the software.

    Just running the following idea "up the flag pole to see if anyone salutes it" (that slang should give you an idea how out of touch I am with things today)

    The idea: we as users create a github repo as a KniterateUsersGroup and use the wiki feature to organize and, importantly,  keep uptodate, some of the shared knowledge here.  We don't need to repeat thing, we can link to existing shared documents and community posts.

  • mark

    TL;DR: please add a date, if possible, to anything you share

    Sorry, this repeats some themes of the last post, but I want to focus on just one thing so it doesn't get lost.

    Sharing is great.  Context is important.  What seems obvious today, is confusing as software and hardware change.  The date isn't perfect, but it  helps with minimal effort to provide a lot of context.

    My personal belief is that creation date should be included in the generated k-code.  If one is hand editing k-code, please add a "created on" comment.  If one is sharing some text, please include a date.  Trying not to be pedantic, just sharing a process learned in the school of hard-knocks



  • Michael Sachen

    Yes I agree with you mark-- Github repo is a great place to start. 

    I'm guessing you're not the one with a kniterate repo labeled test? It was my thoughts that there is some overlap between developers and those who will be working with the machines

    Im pretty sure if you google my screen name and github you should be able to find me. 
    It would be a good place for related research papers as well-- lots of current work in knitting.

    I can put one together in the next few days? 



  • mark

    I'm all for someone else taking the initiative with regards to github. I'm sure with a bit of searching I can probably find your account and follow you. (I mean it's not some obscure site like or some such).

    Was watching video on knitout ( ) when I realized there are lots of standard machine programming techniques I'm ignorant about like half-gauging. Starting locating many wonderful papers, even stuff predating knitout, like Wonseok Choi's Ph.D. thesis

    I read a lots of notes about "Knitting technology: a comprehensive handbook and practical guide" 3rd Ed. by David J Spencer. Hoping to find some way to skim before I commit money since it is on the expensive side. If anyone has experience with it, please share.

  • Robert Ingemarsson

    Would be very interested in contributing in whatever people are developing, and happy to run through the output on our machine :):)

  • mark

    Ok, this will be a bit odd for some of you.  I'm answering my own question in a post still "Pending Approval" (hypothesis: too many URLs included)  ((feel like I'm in some movie with time travel)).

    I asked about the book _Knitting technology: a comprehensive handbook and practical guide 3rd Ed._ by David J Spencer.  Hoping to skim before spending money.  Well I found that I could read/preview the PDF at  If I was going to be a hardware engineer, it would be a great history of the various types  of knitting machine. But didn't see enough programming to warrant spending the money on a physical copy.

    The bonus, it that this morning, because of that viewing,  I got emailed a link to _Handbook of Technical Textiles_ Ed by Horrocks and Anand.  Again, hardware focussed, but still an intersting skim. (Warning, I used to read the encyclopedia in our home for fun as a child, sadly not THE encyclopaedia, Encyclopaedia Britannica)

    Should I get emailed a link to some software oriented academic paper I'll be sure to share.

    If you never hear from me again, I got lost in the rabbit hole of this google search query

    "filetype:pdf knitting"  :)

  • mark

    There is now an Unofficial Kniterate Users Group with github account  and a wiki.  I'm pretty rusty with git and markdown, may take me a while to get my git-legs back again. Living in irrational fear of vandals, currently the wiki can only be modified by collaborators, so some connecting on github will be necessary to edit.  Open to changing rules, just a starting point.  Goal is not an alternative source of information, rather an alternative structural view of the information here.

  • Robert Ingemarsson

    Amazing - Following the repo, and looking forward to seeng what the community can develop...

  • mark

    Prompted  by this thread I queried the knitout repo contact.  Got a reply from Jim McCann today.

    Seems I should have been searching github a bit more this weekend.  This weekend

    was made public.

    WIth warning that these are still under active development. So you have been warned

    was also told of these other useful link and told to feel free to share with other, so, others, you have been shared with :)

    Other useful links:
    - in-browser version:
    - report bugs / discuss features:
    - example knitout that works on kniterate:
    - visualizer for knitout files:

  • Robert Ingemarsson

    Thats very cool.

    have just taken some of the knitout files, and converted them to kCode, and then run on our visualised to see how they look.

    This is the 'shape.kc' file that the knitout- > kcode convertor produced...

    Not sure its perfect, but a good start :):)


  • mark

    TL;DR: Can Kniterate knit kcode that binds on with "tuck" instead of "knit"?

    For some reason this make me think of the old, if a tree falls in the forrest and there is no one there to hear it.

    If there is no loop on a needle, is there a difference between the 'knit' and the 'tuck' operations?  Perhaps more to the point, can Kniterate use the tuck operation on an empty needle.  The design app validation give an error message if one attempts to do it.  But what if one does so any ways in the kCode?  Does the machine knit just fine?  Or is there a subtle difference and the knit op, statistically speaking, is more likely to hold onto the yarn and thus is better for casting on?

    Why do I think it matters.  Much of the CMU knitout material I have seeen, such at the blog post introducing knitout:

    and many of the sample files such as

    start with the tuck operations.

    (Yes there are examples that seem to specifically address the Kniterate preference for "knit" such as:


    My concern is that people outside the Kniterate world that write tools that product knitout, will start with the "tuck" and not the "knit", and that their tools won't have switches that allow one to set a preference for one or another.

    Even if the Kniterate can knit kcode that starts with a "tuck" operation, and the design app is just enforcing a rule in hopes of alerting users to a potential mistake, it doesn't mean all is smooth sailing. Other third party validation tools in our ecosystem might chose to be consitstent with the design app rule and thus not accept translated knitout to kcode code.

  • Michael Sachen

    So after dealing a bit with knitout code-- I have some architectural concerns.

    Mainly, I feel like it would be useful to have explicit implementation of knit graphs -- i.e. the graph that you draw in the kniterate design app (As opposed to implicitly defining via knitout) Then building specific compilers from the graph to  kcode/knitting code .

    This would allow checking for feasibility of knitting graphs for a machine etc.-- it would also allow for higher level compiling from 3D objs to the graph, or knit structures to the knit graph, which is currently difficult from a code perspective. And sharing knitting code between machines easier

    Of course this is all possible now, but as I understand it, would make the concept of a knit graph much easier to work with, as it currently is tailored for non programmers

    Thoughts? How do you guys currently find the knitout work flow?


  • mark

    Encountered these item yesterday, and because they mention KnitGraph, thought I would share in case you haven't encountered them before, admit its a crap-shoot whether they are relevant to what you doing/want to do knit graph wise.


  Question at  end of [2] seem to align with what you are saying and indicating that still very much an open problem.

    Understand the urge to want to roll your own, and if I worked to stuff that had time or money resource constrains, I definitely lean that way to get things going.  Those days in in my past, so I tend to lean to using other peoples stuff whenever possible.

    It's hard to claim that you should be tied to a repo that has been public less than a week.

    All that said, it seems like you should be able to organize the code so that the Knitout vs homegrown lives in a box in some conceptual pipeline, and you could start out using the knitout to attempt to compile the code, and when you find that it doesn't work for you, replace that contents of that box with your own stuff which address the shortcomings that you've learned.

  • mark

    Have been reading 'knitout-to-kcode.js', and would suggest it worth a look through no matter what direction you choose to go (roll-your-own vs. knitout).  The code is much less than 2000 lines of code, and no matter what direction you go, you are going to need an object somewhat like the 'Pass' that they use in knitout-to-kcode.js to model one pass of the carriage on the Kniterate.  The flow is generally: knitout -> Passes -> kcode. 

    ('knitout-to-kcode.js' is a bit of a monolith, so suggest using an editor with code folding to make reading easier.)

    Also, note it is under current revision.  Great in a couple of ways.  You get to see revisions in near real-time and if you have questions, they are likely to be fresh in the mind of the development team.


Please sign in to leave a comment.