(this was inspired by libfive, antimony and Ronin)
EDIT: see a Proof-of-Concept demonstration and explanation video here.
an electronics CAD software could have a livecoding typing area somewhere, here illustrated with some Clojure pseudocode: (I chose a lisp-y thing because originally I thought that was going to be relevant, but now I see it is not at all necessary. Which is good news because it means this could be built more easily on top of the KiCAD API as it is, potentially.)
(let [rect (select-rect)
footprints (sort by-name (select-footprints))