A gun is a type of ranged weapon accessory. They are currently a rarity in Erfworld, but Charlescomm keeps a large and secret supply to defend its capital. Ace Hardware is known to have created a ray gun with Dollamancy, and Erfworlders have at least some vague awareness of their existence.
However, Ace Hardware's products are magic items and fire a form of Shockmancy. Charlescomm's rifles fire bullets and are reliant on ammunition produced by Dirtamancy. They are auto-specialled with Archery specialist, rifle, though rifles created by other Dollamancers like Ace Hardware are notHvs.tCF 156. Accuracy with a rifle is greatly diminished without this special, which is not believed to exist naturally in Erfworld Hvs.tCF 156.
Despite claims made by Jojo in Hvs.tCF 125, guns that use bullets are not instacroak. This is demonstrated by attacks on Lilith in the Hvs.tCF 122. The use of a Mass Health Healomancy scroll by Wanda in Hvs.tCF 122 implies that these guns have low damage but high crit chance.
Lilith and Marie knew how to handle Charlescomm's firearms from the first moment they picked one up, each described instinctual knowledge imparted by a weapon itself, and they had previously been rumored to be an item of Dollamancy or Weirdomancy. This knowledge seems to only be imparted upon Erfworlders, not Stupidworlders like Parson. It is possible there is a Weirdomancy enchantment on Charlescomm's rifles to help his units use them more efficiently.
It is possible that firearms were invented during a Dirtamancer/Dollamancer link.
Real World References
See the gun wikipedia article.