Qatar is a good place to think about migration. Thanks to a combination of a tiny indigenous population and the vast drawing power of Qatar’s gas wealth, some 75 per cent of the emirate’s population is now foreign-born (including me) — the highest proportion of any country in the world.

Such a demographic shift might have been predicted to bring political upheaval, a ferocious backlash on the part of the indigenous population as it saw its society being swamped, its culture transformed, and its political dominance destroyed, and conflicts that would ruin the country.

The single most important factor preventing this has been the sheer amount of wealth derived from gas, which both provides well-paid jobs to the migrants and is distributed in such a way as to reconcile the entire native Qatari population to the situation.

But the demographic transformation has also been managed by a number of clear and ruthless rules. There is no question of citizenship for us migrants, or indeed of any political rights whatsoever. Migrants do have legal protections, but in practice these are highly dependent on the nature of their job — a situation that has led to numerous abuses.

This denial of rights is made easier to maintain by the fact that Qatar is an autocracy in which, formally speaking, the native population has no democratic rights either — though in practice and in accordance with tradition, the government is very careful to maintain high levels of consultation with indigenous Qatari society. Since no one pays income tax, the principle of “no taxation without representation” does not apply.

Since we migrants have come in order to earn money through work, our right of residency is entirely tied to our work. Our ability to bring in spouses and children is limited to certain professions and levels of income. There is no right whatsoever to bring in other relatives through “family reunification.” There is no right of political asylum. Individual cases are granted at the discretion of government. As far as cultural and religious norms are concerned, Qatar is far less repressive than Saudi Arabia, but it does insist that everyone defers to its traditions in terms of public behaviour.

And while harsh, these rules are on the whole necessary if the tiny population of Qatar is to go on admitting huge numbers of migrant labourers without conflict. As the government has admitted under pressure from international human rights and labour organisations, it does need to do more to guarantee certain basic legal protections — though notpolitical ones — for its unskilled migrant workers. I am grateful to the state of Qatar for the ability to come here, and will obey its laws and its public norms of behaviour, but like the overwhelming majority of my fellow migrants, I am not attached to Qatar by history, culture, religion, or heredity, and it is very unlikely that I shall become so. It would therefore be ludicrous for me to claim citizenship or a right of permanent residence in this country.

By the same token, the Qatari state on its side has no right to demand from us migrants what in ancient Greece and Rome and until recently in the modern West was the essential price of democratic citizenship: a readiness, if called upon, to serve in arms and, if necessary, die for the country of which you were a citizen. To ask this, Qatar would have to hire me as a mercenary soldier. I’d certainly look at such an offer — there were mercenaries on both sides of my family in previous ages — but there are probably more suitable candidates for this job.

These Qatari rules may be ruthless, but they have a moral as well as a political and economic basis. Contemporary Western states, by contrast, have fallen into a state of utter confusion on the subject of immigration, in part because of economic, social, and cultural developments that have destroyed the frameworks by which the great waves of 19th and early 20th century migrants were integrated. Notions of citizenship have been divorced from those of duty and notions of community and society from those of culture. Meanwhile, the globalised economy and its attendant ideology have stripped states — in perception, if not necessarily and completely in reality — of the ability to think seriously about creating economies that will serve national aims rather than those of the “market.”

If it is true that no Western state yet approaches 75 per cent of its population in terms of migrant origin, the last British census showed that 37 per cent of the population of London were not born in the United Kingdom. Half of the foreign-born residents arrived in just the ten years before the census, from 2001 to 2011. Only 44 per cent of the population are now whites of British origin. This shift was largely due to migration from Eastern Europe following its admission to the European Union, but over recent decades older immigrant populations from the Commonwealth have also risen steeply and continuously.

Between 2001 and 2010 the Muslim population in Britain increased at a rate almost ten times faster than that of the rest of the population. According to the censuses, in 1981 Muslims made up 1.11 per cent of the population, in 1991 1.86 per cent, in 2001 3.07 per cent, in 2011 4.80 per cent. The particularly steep rise since the late 1990s is partly due to the Blair government’s extension of opportunities for “family reunification,” as a move to retain the Muslim vote in Labour constituencies. Other European countries are proceeding along the same path.

And at least as far as large sections of the Muslim immigrant populations in the West are concerned, it is now absolutely clear that a presence of more than half a century has not brought about successful integration into Western societies. Why? Because the Western industrial economies, and the local societies and cultures which they underpinned, which provided the attraction basis for the initial waves of migration, have long since ceased to exist.

In the northern English mill towns where the forefathers of most of the Pakistani population moved to work, there is now barely a single mill. With the factories have gone the entire infrastructure of local working class life, which played such a critical role in integrating previous waves of immigrants. The result is all too often a local white society into which no sensible and decent person would wish to integrate, even if the opportunity to do so were available. Meanwhile the combination of the rise of Islamist extremist groups and Western policy in the Middle East is offering to alienated Muslim youth a terrifying means of expressing their anger and frustration.

Put the following stories together: the British census results; the vastly increased numbers of mostly Muslim illegal migrants trying to cross the Mediterranean into Europe, partly as a result of our destruction of the Syrian state; the support of Britain, France, and Australia for US airstrikes against the Islamic State terrorists; the departure of hundreds of Islamist volunteers from immigrant populations in Western Europe to fight for the Islamic State in Iraq and Syria, even after that force began to murder Western hostages; reports of possible terrorist attacks by these fighters when they return home; the massive sexual abuse scandal involving men of Pakistani origin in Rotherham and other towns in Northern England; the steep rise in the vote for far-right anti-immigrant parties not just in France but in supposed havens of social democracy like Sweden; and the surge in support for the UK Independence Party to 26 per cent, with polls showing that the biggest reason by far is anxiety over immigration.

This combination forms a pattern that may very well end a few decades down the line with the death of western European democracy, brought about by a combination of growing Muslim numbers, continued Muslim social and cultural alienation, growing Muslim anger at Western policy in the Middle East, terrorist incidents, and backlash from the indigenous white populations.

Right and left are equally guilty here. Lost in an impenetrable fog of fatuously optimistic fairy stories, the left cannot think seriously about the need to reduce migrant flows or about issues of social integration, national loyalty, and the duties as opposed to the rights of citizenship. The right, for its part, cannot think seriously about the state-led economic policies and the restrictions on free market capitalism which are needed if there is to be any hope of restoring the economic basis for successful integration. The right also cannot think seriously — indeed, often seems incapable of thinking at all — about human-generated climate change, which poses both the greatest threat to our civilisation and the greatest opportunity for a new industrial revolution.

Nor can the right think about the adjustments in foreign policy which will have to be made if we are not to go on infuriating a growing part of our own populations. The Australian, French, and British contributions to the US air campaign against the Islamic State are absolutely symptomatic in this regard. They are so pitifully small that they can have no effect whatsoever either on the campaign itself or on the alliances with the United States. If Washington continues these alliances, it will not be because of these ridiculous efforts but for very good US strategic reasons. At the same time, however, the British, French, and Australian actions are quite enough to infuriate large sections of their own Muslim populations, and push the wilder elements further towards militancy.

The contrast between this military effort and the extent of the challenge posed by migration to our own societies verges on the surreal. This challenge is so great that the measures that need to be taken to address it, in terms of state effort, economic commitment, and the rethinking of basic attitudes, approach those of wartime — and serious war, not our recent comic opera performances.

The general lines of policy would have to include much tougher controls on immigration, with political asylum and family reunification formally abandoned and spending diverted from the military to strengthening border controls; extreme caution concerning any further military actions in the Muslim world, with counter-terrorism strategy concentrated instead on securing our own borders; and comprehensive plans for national integration, involving both cultural programs comparable to the great nation-building exercises of the late 19th century, and new economic strategies which would have to begin to compare to those of wartime, intended to regenerate the depressed post-industrial areas where migrants congregate

None of this is likely. Indeed, it may not be possible at all. But nor do I think we can simply drift along as we have been doing without risking our own destruction as democratic societies.