Explanation: One of the earliest gunpowder weapons was the Chinese fire lance, a spear with an attached container of projectiles and gunpowder to start off combat with a bang!
Much later, the gun would be invented, and then, a considerable time after that, the bayonet invented - that is to say, the idea to stick a point on the end of the gun to make it a combo spear-gunpowder weapon.
Technology is truly cyclical
(don't tell the reformers)