Ireland was a country that thought it could not compete before the 1990s. Its rail system was primitive, its ports were outdated and small, and its roads were problematic — mostly you had to share them with sheep or tractors hauling peat wagons.

It looked as though Ireland was doomed to be one of the least competitive countries in Europe and would continue to have “structural” unemployment of 20 percent and higher.

Then a miracle: Ireland combined its greatest assets — literacy and superior education system — with the computer revolution, and it became a boom country. Ireland, rather than depending on exporting bacon, butter and linens, started exporting services by internet.

It became a computing center for Europe, and American and Asian companies flooded in. Galway, a university town, was ground zero for top computer companies.

Ireland went from nowhere to wearing the crown of “Celtic Tiger.” Businesses around computing, and those serving the foreign executives, boomed. Ireland shook off the dead weight of centuries.

There are lessons in the Irish experience for cities as they struggle to become “smart cities” and to compete as the smartest cities in livability and business friendliness. Can some ailing Midwest or Upstate New York city burst the bonds of their Rust Belt past and find a new future as smart cities, attracting investment and technology-based business?

Largely unseen, cities from Rochester, N.Y., to San Antonio are seeking the title, even though the full dimensions of what makes a city smart are still being thrashed out.

A global study, undertaken by the Singapore-based Eden Strategy Institute, puts London at No. 1 and Singapore at No. 2 in the world. New York leads in the United States, closely followed by Boston; Rochester, N.Y., is on the list. Out of 50 world cities, just 12 U.S. cities make the list.

But many smaller U.S. cities are in the race to be the super-smart, from Fort Lauderdale, Fla., to San Antonio. Smart cities are a place where the old world of bricks and mortar meets the new world of artificial intelligence.

The players, besides the cities themselves, are the telephone giants (especially AT&T and Verizon), the electric utilities, a wide variety of software vendors and consultants. They are vying with each other for business at the city and county level.

The telephone companies are hoping to use their emerging 5G technology as the way in which machines and systems will talk to each other. IBM is interested in all aspects of the city of the future, including the use of blockchain as the primary recordkeeper. Amazon wants to begin smart deliveries, maybe by drone.

Even law firms — and Dentons, the world’s largest, is out front — will be needed to write the contracts and guide their clients. Clinton Vince, who heads the U.S. energy practice at Dentons, says the firm has taken the unusual step of establishing a “think tank” within the firm to work on smart cities.

Smart cities implementation needs local political approval and encouragement; the action is in the city councils and mayors’ offices, and county boards, not in Washington.

As with so many things, it is technology that may change our lives as much or more than policy. Already, the effect of computing in the way we live in cities can be seen everywhere — from those pesky scooters that are on the streets of many cities, and which rely on computer networks and GPS, to Uber and Lyft ridesharing and Airbnb.

Down the road, smart technologies will have to decide how electric cars are to be charged and where; how autonomous vehicles will operate in cities and where they will park themselves between assignments.

The building blocks are electricity and telephony. They will also be the managers of the old infrastructure, surveilling pipelines, water systems, roads and even traffic lights. The idea is to slave the old infrastructure to the new infrastructure for efficiency and instant response to problems.

Some cities will lead, but none will be unaffected. Smart is coming fast and will be here to stay. Will those who do not catch the wave become “stupid cities”?