
Firearms constitute a prime example of a technological race. Now, through the miracles of etymology, firearms might be either "flaming arms" or "arms that make use of fire". Although early firearms may have lead to plenty of conflagrated limbs (and torsos), the concept of arms here ties in with weapons (Old French armes from Latin arma (weapons)) and not arms (Old English earm from Latin armus (shoulder/upper arm)) - both of which are from the Indo-European root of ar- (too fit or join). Firearms have three separate components that influence their effectiveness: the gunpowder, the bullet, and the design. These three factors facilitate faster firing rates, more range, cheaper manufacturing, more mobility, and easier use - all of which were desired since firearms were invented.
General consensus lands the discovery of gunpowder sometime in the 800s in China. The use of recognizable guns in China dates to the 1100s (occasionally Arabic scholars argue this point). This often leads to the misconception that early gunpowder use focused on fireworks or the idea that the peace-loving Chinese couldn't find a use for it in wartime. The advent of gunpowder coincides with the downfall of the Tang dynasty (not to be confused with the Tang dynasty - easy way to differentiate them: only one is "orangey") and the emergence of the war-filled Wudai and Shiguo (Five Dynasties and Ten Kingdoms - wu (五) being five, shi (十) being ten) period and the warfare that accompanies more than ten states in an area less than half the size of modern China. Recognizable firearms developed during the subsequent Song dynasty (not to be confused with the, uh...song dynasty?), but despite the empire's relative stability, they weren't any strangers to war either. Turns out Chinese people were all about burninating the countryside.

Ingredients and Processing
Early incendiary mixtures consisted primarily of sulfur and charcoal. These mixtures wouldn't provide any explosive punch, but worked well enough for burning things (I'll avoid linking non-Trogdor again...for now). The third essential ingredient of medieval gunpowder was saltpeter (or potassium nitrate, KNO3). Mined from areas of China and India, Chinese alchemists had relatively easy access to the chemical. In Europe, saltpeter remained elusive until alchemists uncovered suitable amounts of the chemical in a more obscure form. The initial source for saltpeter in Europe came from
Here's another fun fact: saltpeter often functioned as a food preservative in the middle ages. Hopefully you're not reading this during lunch. The historical reenactors among you may be happy to know that the modern production of black powder does not rely on urine.
The basics of effective black powder had finally arrived by the early 14th century. Recipes proliferated, offering a variety of additives and proportions. The theoretically most effective ratio nears 75% saltpeter, 12% sulfur and 13% charcoal, however medieval chemists tended to use far less saltpeter (the hardest component to produce). Recipes usually took a form of basic ratios, such as 7 parts nitre, 5 part brimstone and 5 part charcoal. The standardization of black powder in a form close to its theoretical explosive limit didn't occur until the late 18th century.
Beyond the evolution of the formulas, methods of transporting and mixing the constituent components developed as well. Engineers discovered that mixing the saltpeter into the sulfur and charcoal just before firing resulted in a more reliable explosive force (although it tended to produce a lot of powder dust which was prone to ...exploding). Gunpowder was often milled as a function of the mixing process, providing relatively consistent powder (compared to mortar-and-pestle mixing, anyway).

Materials and Shapes
I would be remiss if I didn't point out that gunpowder developed into a general purpose explosive. Arriving sometime after 1250, firearms developed relatively quickly into projectile weapons but saw other uses as well. Black powder was used in civil engineering (mining, canal building, etc.), but proved especially dangerous due to the inconsistency of the powder and the lack of reliable fuses. Besiegers also used the explosive mixture to great effect. The most famous of these for us now are petards, which come to us with the phrase "he was hoisted by his own petard" as in "he was foiled by his own plan". But, like our contemporary association with the word firearms, the most common weapons to make use of fire were guns.

During the early centuries of gunpowder use, siege engineers favored cast bronze cannons. Leaders preferred forged or cast iron guns for their economical price. Metallurgical processes of the period meant that it was easier to cast bronze (or much more expensive brass), than iron. The pliability of bronze also made it easier to notice when a bronze cannon had undergone too much stress due to a large bulge that would form. Iron cannons tended to just explode due to their brittleness (this tends to be the reason why the operators preferred bronze guns). Although generally stronger as a metal, iron metallurgy and refining processes slacked behind bronze. The picture in de Milemete's depiction is a cast piece, probably of bronze or brass (due to the color). Forged iron cannon consisted of a tube (often of wood covered in metal slats) held together by rings of iron.

The Part That's Supposed to Hurt People
Projectiles came in a variety of shapes and sizes. De Milemete's depicted cannon fired a dart (or shortened arrow). Early ammunition often came from rock, something that tended to be rather plentiful. Round bullets or shot became the preferred standard (as round as you can make a rock, anyway). As gun calibers became standardized, metal ammunition began to readily replace stone. Shot, darts, and bullets all had separate tactical applications and saw use as their production processes became more refined. This is the part where the euphemism of a cannon as a big hard tube with balls comes in.
Until the advent of the cartridge and primer, the vast majority of firearms were muzzle-loaded (loaded down the barrel and then rammed into position). Only very small cannon tended to be breech-loaded (loaded into the rear of the weapon, right into the firing position). Until machining caught up, these required a removable chamber held in place by a wedge to make them nearly air-tight for firing.

Hand-held Firearms and Locks
Hand-held firearms took off when someone decided to make a cannon small enough to be held by one person (one crazy person, these things often exploded when firing after all). So it's no surprise that early handguns (or handgonnes or whichever phonetic spelling you prefer) looked like miniature cannons. Like their cannon-y counterparts, these weapons required their operators to insert a charge of powder, ammunition, and then light the whole thing off with an open flame. The flame would ignite the priming powder (held in a small receptacle called a flash pan), whose flame would travel through a touch hole and fire the weapon.
Turns out even people who ran at each other with big knives thought this was dangerous. In early artillery and handcannons, a linstock (essentially a big fork) held the match so that the weapon operator could try not to die when he fired his weapon. Eventually safer and more useful firing mechanisms (or locks) developed.

Early firearms like the arquebus and the later, heavier musket often required soldiers to rest their weapon on a window sill or a Y-shaped fork in order to aim. The word arquebus, like its shotgun-like partner the blunderbuss, comes from Dutch. Arquebus - and its counterparts harquebus, hackbut, hagbut and the like - comes from the Old Dutch hākebusse and German hakenbuchse or hook gun (due to hooks that were originally cast onto the barrel so that it could connect to the Y-shaped firing stand). While blunder may be an appropriate word for a weapon prone to blowing up in the operator's hand, it was most likely named for its loud, thunderous report (so, thunder gun).
The addition of these intricate parts encouraged developments in the shape of the weapon into something we could reasonably call a gun today. And because running around with a flaming wick was considered dangerous, development towards safer and more reliable locks proceeded.
The next advancement in the early 1500s, called the wheellock (or German lock), allowed the operator to carry the weapon loaded and fire it without an open flame dangling about. Using a piece of fool's gold (or iron pyrite, FeS2), a spark would be created by having the mineral snap against the flash pan's cover, pushing it out of the way, where it would fall on a rotating wheel and create a spark. The mechanism required the operator to fire the weapon gangsta-style so that the spark would actually ignite the powder in the flash pan (...and because medieval soldiers were gangsta, yo). It also took longer to fire than simply touching a match to the flash pan, but avoiding exploding oneself is probably preferable.

Further advancement brought us the familiar firestarting trick of snapping flint against steel. Coincidentally enough, this type of firing mechanism is referred to as a snaplock. The snaplock functioned much like the wheellock, except the flash pan had to be opened manually (and it was cheaper to produce with fewer moving parts). The flintlock (or French lock (or even English lock, depending on who's doing the shooting)) solved this problem, by combining the flash pan cover and the steel target for the flint into one simple L-shaped piece of steel called a frizzen. The simplicity of the flintlock lead to its dominance in weapon manufacturing for over three centuries until the implementation of percussion caps and primers in the 1860s.
Firearms: proving the versatility of Urine™ since 1326.