Mariano Guerra
Kartik Agaram
Jimmy Miller
Andrew Carr
09/06/2020, 1:26 PMJack Rusher
09/06/2020, 1:54 PMJimmy Miller
What is the fundamental difference between TDD and coding by example?To put things a different way, TDD is about a human providing examples and then a human coding to make those examples work. Programming by example is about allowing a human to provide example and then the program is automatically derived from that example. More in line with what @Jack Rusher is talking about is this section from Bret Victor’s magic ink that goes into more in depth with an example. http://worrydream.com/MagicInk/#designing_a_design_tool In fact in this essay, there is a quote that relates the kinds of things Jack talked about to the kinds of things I was discussing.
Many systems attempt to infer a full computational procedure, and have the most difficulty with computational concepts such as conditionals and iteration. As we will see, this tool mostly has to infer mappings from some set or numerical range to another—functions in the mathematical sense rather than the (imperative) computational sense. This may be significantly easier.Barliman is a system that tries to infer full computational procedure. The systems Jack is talking about are much more inline with what Bret is achieving, inferring particular relations given a graphical input. The point of my example in my talk is that there might be some way in which we can take ourselves much further into inferring from examples to computational procedures, by changing up our programming models. I absolutely love the work that Jack linked, but I would love to see programming by example become a more general technique useful beyond domain specific cases and with some nice underlying model that can be broadly applied. In other words, I just want to work from the ground up to get something that can power the various awesome projects that Jack posted without having to code those interactions specifically.
Andrew Carr
09/06/2020, 3:29 PMJack Rusher
09/06/2020, 4:39 PMsuggest
function that does this weaker but still potentially useful "suggest possible code based on a before/after pair":
(suggest [1 2 3 4] :=> 1)
;; (("first" [1 2 3 4]))
(suggest [1 2 3 4] :=> 4)
;; ((last [1 2 3 4])
;; (peek [1 2 3 4])
;; (count [1 2 3 4]))
(suggest [1 2 3 4] :=> [2 3 4])
;; ((rest [1 2 3 4]))
(suggest [1 2 3 4] 3 :=> [2 3 4])
;; ((rest [1 2 3 4])
;; (take-last 3 [1 2 3 4]))
(suggest [1 2 3 4] 1 :=> 2)
;; ((second [1 2 3 4])
;; (nth [1 2 3 4] 1)
;; (get [1 2 3 4] 1))
(suggest 1 [1 2 3 4] :=> [2 3 4])
;; ((rest [1 2 3 4])
;; (drop 1 [1 2 3 4]))
Jack Rusher
09/06/2020, 6:46 PM