I want a gun that shoots ethical flechettes. That is, the gun has the situational awareness at least of a policeman that's hiding in your pocket or handbag. It talks to the ammunition. Of course, the gun would talk with you.
I calculated that a human-equivalent-intelligence (HEI) would fit into several thousand cubic microns, and with quantum intelligence, it could run several thousand times as fast as human time. (mechanical is smaller, but slower)
With good nanotech, we can also have lasers running off a phased-array on a flechette, so we can get a pin-hole microarray radar that's not too constrained by the reolution radius of its antenna.
You shoot it, and the flechettes decide what to do, and the gun is the witness, and sends signed e-mail to the police on the wireless internet using micropower pulse radio.
If you're a bad guy, a dumb kid, or a drunk, or tampered with the gun, the flechettes refuse to fire. or tumble at mach 8 and self-destruct, because they're inherently unstable.
If you're a good guy, the flechettes cause the least possible damage that will let you get away, shoot the deer that's kicking your kid, hunt, hit the 9 ring of the paper target, or whatever.
The magazines rebuild the flechettes from CO2 and water in the air, plus electricity. Maybe this takes a while, if the only solar cell is the surface of the gun. That way, in a survival situation, the gun is self-provisioning.