Can you name a small, mountainous country, primitive and backward, ruled by shifting coalitions of tribal leaders until a band of religious zealots came to power and proceeded to outlaw every form of enjoyment and to destroy priceless religious icons? You might think of Afghanistan. I have in mind the country my ancestor Thomas Boaz left in 1740 — Scotland.

The analogy first occurred to me when I began reading about prospects for a “loya jirga” in Afghanistan — a gathering of tribal leaders, perhaps presided over by the exiled king, to choose a new government for the liberated country. It sounded primitive in ways, but also very familiar. Self-government in Europe had its origins in such gatherings, from Runnymede to the new medieval cities of Germany, where men chose one of their number to rule. Later, of course, those early assemblies grew into elected city councils and national parliaments. While Afghanistan might be some centuries behind Europe, a “loya jirga” sounded very much like the gatherings of nobles and clan chieftains — that is to say, tribal leaders — in old Scotland.

Despite the romantic image — Bonnie Prince Charlie, colorful tartans, misty castles — early modern Scotland was a pretty dreary place. In “The Scotch-Irish: A Social History,” James G. Leyburn describes typical country life around 1600: “A cluster of hovels housed the tenants and their helpers … Floors were of the earth itself, and mud from the farm-yard was tracked into the house to compound the filthiness. Since sanitary arrangements were wholly lacking and since animals slept in the same fetid room, vermin abounded.”

Moreover, the Reformation did not just sweep away the perceived corruption of the Roman Catholic Church. John Knox set out to impose God’s rule on the whole society. Gambling and theater were banned. No working, dancing or music was allowed on Sunday. Traditional celebrations such as Carnival, Maytime and Passion plays were banned. Blasphemy and adultery were punishable by death. Knox’s followers even smashed stained-glass windows, saints’ statues, and other priceless works of art — as marks of idolatry.

One should be careful about comparing anyone to the Taliban, but the Scottish reformers seem to have set quite a standard for religious fanatics.

And yet a new Scotland was growing. Literacy was spreading. The universities were opening to new ideas.

The Act of Union with England in 1707 made the Scots part of a larger and more advanced nation.

Within just decades, the Scottish Enlightenment was underway. By the late 18th century, the most important books in Europe were Scottish books, beginning with Francis Hutcheson’s “System of Moral Philosophy” and Lord Kames’s “Sketches of the History of Man” and going on to Adam Smith’s “Theory of Moral Sentiments” and “Wealth of Nations,” David Hume’s “Treatise of Human Nature,” Adam Ferguson’s “Essay on the History of Civil Society” and more.

And not just books: the inventor James Watt, the architect Robert Adam, the road builder John MacAdam, the bridge builder Thomas Telford and later Scots such as Alexander Graham Bell and Andrew Carnegie demonstrated the practical side of Scottish philosophy.

So what does all this have to do with Afghanistan? Just possibly it offers hope to Afghans who want to build a modern society. That can’t be done instantaneously. It was almost 200 years from the rise of John Knox until the first books of the Scottish Enlightenment. But the transformation from 1700 — when Scotland was still poor and backward — to 1758, when the son of a British prime minister could call it “the most accomplished nation in Europe” and Voltaire could note that “it is to Scotland that we look for our idea of civilization,” was swift and remarkable. And with modern technology and communications the process could be faster.

From 1780 it took England 58 years to double its wealth, while a hundred years later Japan did it in 34 years and another century later it took South Korea only 11 years. The idea of progress was crucial to the Scottish theory of history, and Scotland’s own progress in that era was a great illustration of the possibility. May Afghanistan know the same history.