Thermal computing with mechanical transistors