Guns should know where they are and if another gun is nearby. Global positioning systems can meet most of the need, refining a gun’s location to the building level, even within buildings. Control of the gun would remain in the hand of the person carrying it, but the ability to fire multiple shots in crowded areas or when no other guns are present would be limited by software that understands where the gun is being used.
Guns should also be designed to sense where they are being aimed. Artificial vision and optical sensing technology can be adapted from military and medical communities. Sensory data can be used by built-in software to disable firing if the gun is pointed at a child or someone holding a child.
Building software into guns need not affect gun owners’ desire to protect their homes. Trigger control software could be relaxed when the gun is at home or in a car, while other safety features stay on to prevent accidental discharges. Guns used by the police would be exempt from such controls.