It’s become hard to imagine a future without robots. From the cold-blooded killing machines of the Terminator films, to the married-couple bickering of C-3PO and R2-D2, they’ve appeared as our enemies, our servants and often our rivals.

Now the real-life robot revolution is beginning – and it’s already causing the first stirrings of panic. In policy circles, the new must-have book is Erik Brynjolfsson and Andrew McAfee’s The Second Machine Age. It argues that artificial intelligence is going to cause huge disruption, as a host of everyday functions – driving ourselves to work, doing the shopping, sorting through spreadsheets, even treating cancer patients – get annexed by machines.

As my colleague Jeremy Warner has pointed out, the economic consequences will be huge. In one study, academics estimated that 47 per cent of US jobs are vulnerable to automation. In China, the industrial giants that build the world’s iPhones and Xboxes are investing heavily in robot workers on the principle that their cost is already comparable with that of flesh-and-blood humans, and will soon be far lower. And Google is snapping up robotics firms as if on a billion-dollar trolley dash.

All this has created something of a cottage industry in academic doom-mongering. In Average is Over, the US economist Tyler Cowen predicts a two-tier future, in which those who can harness the abilities of intelligent machines enjoy undreamt-of opportunities, while those without such skills rot in wasteful idleness. In his own new book, the journalist Clive Thompson counters with an analogy from chess. Yes, a computer can beat a grandmaster – but a human working with a computer will beat both hands down.

Even as this discussion rages, however, a new fear has been raised – that robots won’t just steal our jobs, but our hearts, too. The American technologist Ray Kurzweil – Google’s director of engineering, and the John the Baptist of artificial intelligence – predicted this weekend that robots will be our social as well as economic superiors. By 2029, he says, they will be able to tell better jokes and stories.

This is the premise behind Her, a film from Spike Jonze in which Joaquin Phoenix falls in love with his operating system – effectively, an advanced version of Apple’s Siri (it doesn’t hurt that the AI comes with the voice of Scarlett Johansson). It makes perfect sense. Wouldn’t someone who could comb through all your emails, and read all your texts and diary jottings, know you better than you know yourself? If they were programmed to take care of you, wouldn’t you feel like returning the favour?

In fact, the problem might not be how hard we find it to let robots into our lives, but how easy. In her recent book Alone Together, the MIT psychologist Sherry Turkle draws on a lifetime of work to show how easily and how eagerly we accept the affection of artificial devices. Whether it’s the children who obsess over Furbys and Tamagotchis, or elderly care home patients petting robots patterned after baby seals, we’re desperate to imbue their responses with real human emotions, to convince ourselves these unthinking creatures care.

For Turkle, this is an alarming, even terrifying, scenario. The drift of technology, she says, means that we are expecting more from our machines and less from each other – and substituting the messy business of romance for the comforting but artificial security of an affection-mimicking algorithm. The Japanese are already fretting about the rise of “celibacy syndrome”, in which young people shun real-world romance, in large part for the comforting flicker of the computer screen.

As with the economy, the best hope is that we end up with a middle way – an alliance between machine and human rather than unhealthy dependence. You can see this emerging in the dating sites which use cutting-edge data-processing to find you the perfect partner – or in the idea that the iPhones of the future may also play matchmaker, monitoring your date’s heartbeat and pupil dilation and alerting you when it’s time to move in for a kiss.

Of course, Kurzweil and others are thinking far beyond this. He is a leading proponent of the “Singularity”, the idea that artificial intelligence will inevitably get smart enough to upgrade itself – and that when it does, it will do so with blinding speed. At that point, our old distinctions between human and computer intelligence could become meaningless, as humans use computers to enhance their brainpower, or copy their minds into the electronic cloud.

In this world, objecting to machine-human unions might seem as nonsensical as opposing interracial marriage today. A better question – if the biological/technological divide does persist – is whether these electronic brains would want anything to do with the antiquated lumps of flesh from which they sprang.

 The writer is acting Head of Comment at The Telegraph, where this article first appeared.