Nitin Alabur is an iOS developer from India who lived in the US and dreamed of creating a tech startup. “I had a zillion ideas,” he tells me. But he’d been hired by a US firm under an H-1B visa, which ties you to your employer. A green card that would make self-employment possible was years away. “It felt like shackles,” he says.

So he bailed. Alabur fled for a place where it’s much easier for ambitious immigrants to pursue the American dream: Canada.

He discovered, to his delight, that Canada issues work permits to highly skilled immigrants in mere weeks, and permanent residency—the equivalent of a green card—in less than six months. In late 2018, he and his wife became permanent residents of Canada, and they’re now building a financial services startup. He soberly warns other young Indian engineers and students: There’s no point moving to the US. Head north instead.

Immigrants! They get the job done, right? For years, America believed that creed, and high-tech innovation was propelled by plucky newcomers from Nikola Tesla to Sergey Brin of Google to Eric Yuan of Zoom. For years, Silicon Valley won the global race for talent.

But there’s a new global winner: Canada, and particularly Toronto. Since 2013, the tech scene there has grown faster than in any other North American city. In 2017, Toronto added more tech jobs than Seattle, the San Francisco Bay Area, and Washington, DC, combined; in 2018 (the most recent year for which numbers are available), the city was second only to the Bay Area in new tech jobs. Toronto is so crammed with immigrants that nearly 50 percent of all residents were born outside the country.

“I call it our secret sauce,” says Humera Malik, founder of Canvass Analytics, which creates AI that helps factories monitor their machinery and processes. Malik, who is from Pakistan, hired over three-quarters of her firm’s engineers from abroad, including Iran, Singapore, and India.

What happened? For one thing, Silicon Valley, now a victim of its own success, is unlivably expensive. Toronto is cheaper. There is also Toronto’s pull factor: It has become a global AI hub because it’s the home of deep-learning pioneers like Geoff Hinton at the University of Toronto—and “brilliance attracts brilliance,” notes Garth Gibson, head of the city’s Vector Institute, which supports AI in academe and industry.

But this is also a story of the US actively chasing away immigrants. The system can be laborious to navigate (Yuan’s application was denied eight times before he got in). And it’s gotten harder. Donald Trump began his road to the White House by calling Mexican immigrants “rapists” and then banned travelers from Muslim countries as one of his first presidential acts. This summer, to the horror of Silicon Valley, he suspended H-1B visas for the rest of the year. He proposed, and then under pressure retracted, rules making it nigh impossible for foreign students to remain in the country during the pandemic.

Meanwhile, Canada has been gleefully counterprogramming. The country’s immigration rules have long prioritized newcomers who are educated, highly skilled, and fluent in one of the country’s two official languages. Then in 2017—as Trump’s snarling nativism was building to a howl—Canada created a fast track that lets some skilled foreigners acquire a work authorization in as little as 10 days.

This is a huge boon for attracting AI talent. Doing truly pioneering work in AI requires advanced research and development skills. No country has enough of those people, so they’re all trying to poach from one another. You win by casting a wide net. (Iran? Filled with math savants, and several Toronto firms I talked to have eagerly hired them.)