I spent a few days in Ireland last week, which is never a hardship. The cue was an invitation to deliver a lecture on parallels - historic, current and potential - between Scottish and Irish peripheries.

To most readers, that will be peripheral in more ways than one which is perfectly understandable. The numbers are small yet the existence of living communities and cultures around our mutual edges depends upon them. That is literally a minority interest.

It suggests that peripheries might have more to learn from each other than from the centre while policies not designed for their micro circumstances are unlikely to meet their needs, which is an exact description of what Scotland’s periphery suffers from. Think HPMAs, ferries etc, etc.

It suits the narrative of governments to deal in bigger units. The population of every Irish province has grown so that must be a success story. Ditto the population of rural Scotland. But scrape deeper and numbers conceal continuing decline in places which reflect failure rather than success.

Read more: The sooner Sturgeon and Yousaf are before an inquiry the better

Nobody can travel in Ireland these days without being struck by its cosmopolitan nature. An introverted society which made a disproportionate contribution to the world’s poor and huddled masses has become a magnet for immigration. One in five of the population was born outside Ireland.

The evidence is everywhere; the languages of the streets, the culinary options, the people doing jobs that would otherwise go unfilled, in country as well as city. On many levels, it is a success story which reflects a bold strategy by government, supported by a wide political consensus.

Neither is it all about freedom of movement within the European Union, or even taking a share of asylum seekers and refugees, which Ireland certainly does. There are, for example, 70,000 Brazilians in Ireland. It started with meat factory workers and spread into students and Ireland being a good place to learn English. What’s not to like?

Quite a lot, according to a significant minority of the Irish population. There have been hundreds of protests, some violent, about the creation of camps and use of hotels to house refugees and asylum seekers. There is a hard-core right wing movement and also plenty of quieter opposition to light-touch immigration policies.

The Herald: Conor McGregor railed against rising immigration in IrelandConor McGregor railed against rising immigration in Ireland (Image: PA)

These gained a disturbing profile at the weekend when the MMA fighter, Conor McGregor, launched a vitriolic tirade in the wake of a particularly nasty murder committed by an immigrant. “The Irish government makes me ashamed to be Irish. We are appalled with you all! You can’t fix this. No problem. It is a war then and God is with us.” To reinforce the point, he accompanied his tweet with a bomb symbol.

It was nasty stuff and very far from mainstream but a reminder such sentiments exist in Ireland like anywhere else. In the Irish Times, Fintan O’Toole got the balance right: “It would be crass to deny that racism and xenophobia exist, especially for immigrants who are not white. But still, the settling of such a large influx of people is a great achievement for Irish society.” O’Toole argued that, to safeguard this achievement, Ireland should be “confident enough in our collective ability to discuss, without rancour and hysteria, the implications of having one in five of our people originating from elsewhere. As it happens, many of those implications are ones we have to face anyway”. Among them, housing is the most obvious and urgent.

The Irish Government’s housing plans are based on predicting net in-migration of 220,000 over a decade. Three years in, that figure has been surpassed. An immigration policy that does not take account of such basic practicalities is heading for trouble, or as Fintan O’Toole put it: “Riding our luck is not a good response to one of the most extraordinary changes in modern Irish history”.

Ireland is, for some in Scotland, a poster boy for immigration policy, with an element of justification. Many areas of our economy would benefit from migrant labour. We have nothing to lose and much to gain from Filipino care workers and Brazilian baristas. Insofar as UK policy obstructs that option, it is a challenge to be discussed “without rancour and hysteria”.

Instead, we live with polarised positions. On one hand, immigration policy is reserved to Westminster and that is the end of the matter. On the other, as claimed in a Scottish Government paper last week, only independence can enable us to be “dignified and principled” as opposed to offering a “hostile environment” to migrants.

The options, as ever, need far greater nuance. It should not be difficult to recognise that entirely different immigration policies within a small island would mean a hard internal border. Equally, it should be possible to agree one size does not fit all. As the SNP paper admits: “Scotland is the only UK nation where the overall population and the working age population are projected to decline”.

Read more: David Cameron's return stretches irony to its limit

As in many matters, having two governments in Whitehall and St Andrew’s House which are capable of, and indeed eager to, work together would transform the picture. Everyone could relax and flexibility considered “without rancour and hysteria”. Perish the thought, we could even learn from elsewhere.

While Ireland has one in five born outside the country, the Scottish figure is one in 14. The practical challenges involved in narrowing that gap - including availability of housing - have not begun to be thought through. A radical change in immigration policy without that work having been done is to put the cart before the horse.

In a different political environment, peripheral places would be an obvious starting point for piloting immigration flexibility to meet labour shortages and population decline. I’m sure a couple of thousand Filipinos or Brazilians could be usefully deployed next week.

But they would need somewhere to live which is an essential ingredient of a humane immigration policy – and also, let us not forget, of a humane domestic one. Prioritising such practicalities would be a useful starting point for other good intentions.

Brian Wilson is a former Labour Party MP and Energy Minister