28 points bhaprayan 19 hours ago 4 comments

Hey all —

Sharing a thought experiment I put together. The premise: what might declarative programming feel like for the physical world?

We’re already familiar with this paradigm in software land (eg SQL etc where we declare what we want and the execution engine figures out how).

I didn’t have access to an actuator so I mocked up the concept in software. The way it works is you demonstrate the effect and the system figures out how to achieve it. So say you want to ring a bell and you have a crank. The system will find a way to connect the two. If you add obstacles it figures out how to work around them (runs a constraint solver runs behind the scenes).

I think what’s interesting about this is being able to think about the problem at a higher level of abstraction, with the system figuring out a way to achieve the intended effect.

Anyways, curious to read reactions, feedback, and interesting ideas on how to extend this!

skinfaxi 29 minutes ago | parent

This is cool! I think it would be interesting to expand the language of the world. Right now the interaction with the bell or door is limited (basically binary). Even with binary it would be cool to say ring the bell three times or play shave and a haircut and then a mechanical device that could generate that frequency would be created (for ex a simplistic one would be to skip every other ring for ringing the bell). I guess that would require the world/the objects to account for interactions over some recording period.

bhaprayan 20 minutes ago | parent

Thanks! Great idea, I hadn’t realized the interaction is binary. It would be cool to allow for "continuous" inputs too. The world would have to account for interactions over a recording period right.

Behind the scenes, I’ve tried to make the audio production realistic, so there’s some acoustic modeling going on (eg echoes, attenuation of sound, etc). But yes you could imagine having the input forces be continuous and having the mechanism trying to figure out how to reproduce the sound exactly.

jdw64 19 minutes ago | parent

It seems people think alike. Something that inspired me in the past also had a similar implementation.

[1]https://www.microsoft.com/en-us/research/publication/motion-...

bhaprayan 4 minutes ago | parent

That was cool! Watched the demo video, didn't go through the paper yet. I'm running a simple heuristic to test for candidate solutions and running them through Rapier (https://rapier.rs), but simulated annealing to efficiently search the configuration space would be a nice extension.