Lots of functional theory went into this absolutely bonkers thing. It is entirely possible to synchronize a drawing with something as complex as SVG, so you can swap between coding it and drawing with it as you please. It even preserves template interpolation and things it does not understand like comments and SVG animations (WTF!). I wrote it as a paper so there are lots of citations and some helper simple examples.