I've been looking at programming by demonstration ...
# thinking-together
t
I've been looking at programming by demonstration recently (somewhat inspired by Pygmalion). There are some nice recent examples of using PbD for things like data wrangling (clean up data, extraction, etc.) and I know some examples for visual things (bar chart) - but I was hoping to use PbD to create something like TODO list app - do people in this group know if there are any systems (recent or ancient) that do something like this? I actually have a prototype where I can construct adding of new items to the list using PbD (you do a sequence of actions to create and add an item and then you can replay that), but other things are trickier - e.g. to count checked items or to remove items that are completed, there needs to be some way of parameterizing the actions (so that they can be applied to all items) and specifying pre-conditions (so that they only apply to certain items) - I'm really not quite sure how to best do those...
m
Not directly PbD but it was developed during my PbD/PbE era 🙂

https://www.youtube.com/watch?v=Q9E6gv2raBYâ–¾

PS: 6 years ago 🥹
just to clarify (or confuse), that instadeq is not the same as the current thing called instadeq
more here:

https://www.youtube.com/watch?v=iHthdmM8m2oâ–¾

i
I actually have a prototype where I can construct adding of new items to the list using PbD (you do a sequence of actions to create and add an item and then you can replay that), but other things are trickier - e.g. to count checked items or to remove items that are completed, there needs to be some way of parameterizing the actions (so that they can be applied to all items) and specifying pre-conditions (so that they only apply to certain items) - I'm really not quite sure how to best do those...
What's the limiting factor? Is it, say, that you don't have a good UI to give people access to the programming model? Or do you not have a programming model that allows parameterization?
I guess, it'd help to know what the user-facing affordances are for the parts that are working. It might be that you're missing a representation (like… it's hard to parameterize something if you can't get your hands on it in some way).
t
@Ivan Reese I should do some video of what I've got (once it does at least something) - framing in terms of representation vs. UI is very good! I guess right now I'm missing both - I can imagine possible representation. Currently, this is a sequence of edits that do something to a document (app/whatever). I think I could do what I want if I added a way to say an edit is only applicable if a certain condition holds (otherwise it should be skipped when replaying). The other thing I need is some kind of "apply these edits to all of these things". I think I can add these two things to the representation reasonably well - then the limiting factor will be a sensible UI for those. (So if there are any PbD systems that have similar concepts, I'd be curious how they handle the user-interaction...) It may also be that my current thinking about the representation is wrong - and so if there are other ways of doing this, it would be interesting to know... I remember seeing nice demos in Wrangler - where generalization was easy (you do things on one row, it generalizes to all other rows). But I suppose in document context, you can generalise to something like (perhaps cleverly inferred) CSS selector...
@Mariano Guerra Thanks for the videos! It may not be exactly the answer to what I need, but there is lots to think about there!
i
The other thing I need is some kind of "apply these edits to all of these things".
My thoughts on this, if it's helpful: You need an affordance on your action that allows you to say "I selected this concrete stuff because _it has these qualities_". If the qualities are visible / tangible things you can see and touch (eg: "I selected this object because it is red") then that lends itself quite naturally to PbD, because you don't need much additional representation beyond what's already on the canvas. But if you want to work with qualities that aren't visible / tangible (eg: "I selected this object because it has unsaved changes"), well you have two choices: 1. find a way to make those qualities visible/tangible on the canvas, 2. find a way to expose that stuff via some UI and be okay with the fact that it's a little more abstract.
m
@tomasp on instadeq 1 (the one from the videos above) if you applied an action to a thing inside the collection the inferred action was to that item and you had to "drag the `i`" to make it apply to every item in the collection. On instadeq 2 I did the reverse, by default it applies to all and you have to remove the iterator to make it apply to a single item or a slice. I got some of the ideas from the specter library the idea of reifying/defunctionalizing path transversal and updates may be useful to you
t
Thanks for the ideas (I have some boring things to finish now, but will get back to this soon enough!)
j
I will throw in Max's story-sifting DSL from the interactive digital narrative domain (similar to Ceptre). Their Felt system is interested in nudging long event streams toward finishing the 'incomplete' event sequences. for a sufficiently rich notion of 'incomplete'. Since 'expressive' event sequence authoring is quite hard, even once the action table itself is locked down, that leads to the PbD strategy.
The CSS selector analogy in particular has come up before. Super expressive DSL for preconditions, but the document model cuts against my intuition for a given event stream.
The broad term in IDN for this stuff is 'storylets', which end up producing incredibly flexible data wrangling experiments. E.g. here's a worked example of 'casting calls' that essentially make individual storylets auditable, as Ivan is pointing towards. https://www.hypermagical.com/blog/narrative-system-experiment-reactive-storylets/