Theoretical Computer Science

Can any program be implemented mechanically?

Is it possible to build a single purpose (non Turing complete) mechanical implementation of say, Microsoft Word? Is it possible to implement such things as iterators, first-order functions, the whole gamut of programming techniques? Could gears and other mechanical parts represent data structures or even program objects? At a certain point does this necessitate building a general purpose Turing-equivalent machine, or can each function, variable, etc, have its own unique mechanical construct in the form of flywheels and/or gears, ratchets, what have you? In summary I wonder if any given piece of software on a standard computer could be compiled to a mechanical blueprint.


Yes, it is. Here's how you do it:

You can compile basically any program you like to circuits. See for instance the work of Dan Ghica and his collaborators on the Geometry of Synthesis, which shows how to compile programs into circuits.

  1. Dan R. Ghica. Geometry of Synthesis: A structured approach to VLSI design
  2. Dan R. Ghica, Alex Smith. Geometry of Synthesis II: From Games to Delay-Insensitive Circuits
  3. Dan R. Ghica, Alex Smith. Geometry of Synthesis III: Resource management through type inference.
  4. Dan R. Ghica, Alex Smith, Satnam Singh. Geometry of synthesis IV: compiling affine recursion into static hardware.

Circuits then turn out to reappear over and over in engineering. John Baez gives a big table of analogies of concepts, and works out a lot of connections, in This Week's Finds 288-296. So the circuit diagrams Dan's compiler generates could be instantiated as mechanical or hydraulic systems, if you really wanted to!

                 displacement  flow      momentum     effort  

 Mechanics      position      velocity  momentum     force    
 Mechanics      angle         angular   angular      torque   
 (rotation)                   velocity  momentum              
 Electronics    charge        current   flux         voltage  
 Hydraulics     volume        flow      pressure     pressure 


Comments (2)

  • +0 – Corollary: software patents make no sense. — Oct 31, 2012 at 17:37  
  • +1 – Fantastic answer for a question I barely knew how to ask. Thanks for the added chart! — Oct 31, 2012 at 21:08