President Trump was holding one of his signature “Make America Great Again” rallies when he began sounding off on immigration.

“We want a system that is merit-based,” he said. “They come in on merit. They don't come in a lottery system. How about the lottery system, folks? Do you see that?” The crowd responded by booing the lottery and cheering merit.

Reihan Salam isn’t President Trump. The son of Bangladeshi immigrants, the National Review executive editor is measured and judicious in his arguments, rigorous and data-driven in his conclusions, sensitive to the experiences of foreign-born people of color like his own parents. The diversity visa lottery is not his main target.

Nevertheless, Salam also wants an immigration system that is “merit-based” as opposed to a status quo that exacerbates our country’s divisions by increasing competition for the poorest among us, immigrant and native-born alike, for the benefit of the rich while inflaming the racist.

That’s the point of Salam’s superb new book Melting Pot or Civil War: A Son of Immigrants Makes the Case Against Open Borders. He patiently sorts through the nonsense and hyperbole that permeates the immigration debate to offer a reasoned defense of borders, sovereignty and both cultural and economic assimilation.

“Civil war” reference in the title aside, this isn’t a hardline restrictionist polemic. Salam favors a limited amnesty. He doesn’t advocate immigration reduction. He doesn’t exaggerate, and sometimes understates, what the evidence says about the effects of continuous mass immigration into the United States on public safety, wages, and jobs.

Still, Salam is writing in a climate where all but the most modest immigration restriction and enforcement is increasingly treated as illegitimate. And if Trump can be tendentious and inflammatory in his campaign talk about immigration, so too are his critics who reject in principle the right of rich countries to moderate the flow of poor immigrants for the benefit of their own residents of all races, origins, and backgrounds.

If the worst fears about immigration are unfounded, the idea that importing a large number of young immigrant workers and taxing them to pay for the retirement of MAGA-hat-wearing, Trump-voting whites will result in a sustainable, harmonious sociopolitical situation is at least as implausible.

[Also read: Trump threatens to end aid to 3 countries if citizens enter US illegally]

Mixing worsening income inequality, ugly racial politics, and simmering cultural tensions will predictably lead to bad outcomes. “The danger, as I see it, is that as the logic of the melting pot fails to take hold, and as more newcomers are incorporated into disadvantaged groups, the level of interethnic tension will skyrocket, and we’ll look back wistfully on the halcyon politics of the Trump years,” Salam writes.

His basic contention is that there is a limit to what large-scale, low-skilled immigration can do to alleviate global poverty while such policies can do a great deal to increase the amount of poverty within the United States. This is not the fault of the low-skilled immigrants themselves — they are arriving in ever larger numbers right as American upward mobility is stalling and technology threatens to erase the need for their labor.

Yet we continue to select immigrants less on the basis of skill — roughly a third of immigrant children grow up in households whose heads lack a high school diploma — than to whom they are related.

Immigration policy should also at its heart be integrationist, prioritizing the making of new Americans over the need for the cheapest possible workers. These two goals aren’t always in tension, but Salam writes, “I have come to believe it is possible for the pace of change to be too fast, where established Americans and newcomers come to see one another as irreconcilable strangers.”

Successful immigration is a delicate balance of numbers, time, and the strength of the assimilating institutions of the receiving country. That’s why Salam’s proposed compromise — maintaining, though not increasing, current high levels of immigration while becoming more selective about who is admitted — may concede too much.

In a debate that increasingly pits sentimental cliches against angry slurs, however, there is much to recommend a nuanced argument that tries to pursue a genuine middle ground as opposed to the usual approach of giving the immigration-maximalist side most of what it wants while hiring extra border patrol agents. Salam has written a merit-based book.