In the new Spike Jonze film, Her, a man falls in love with his operating system. In some ways it’s a commentary on modern society and our increasingly intimate relationship to technology; it's about the smartphones we bring to bed and the computers we wear to work. But there is also a lot of truth to the idea that people might fall in love with the ever more intelligent machines that they spend a greater amount of time with each day. For many of the psychologists, social scientists, and experts in artificial intelligence who study this kind of relationship, it’s not a matter of if, but when.

The roots of this research date back to 1966, when an MIT professor named Joseph Weizenbaum created a computer program called Eliza, a "chatterbot" that mimicked a therapist by replying to what people said with leading, vaguely empathetic questions. A classic exchange with Eliza might go something like this:

Human: Well, my boyfriend made me come here.

Eliza: Your boyfriend made you come here?

Human: He says I'm depressed much of the time.

Eliza: I am sorry to hear you are depressed.

Human: It's true. I'm unhappy.

Eliza: Do you think coming here will help you not to be unhappy?

What Weizenbaum observed was that people treated Eliza as if it were a person, and that the software was capable of eliciting engaged, extended responses. The program was clever social engineering at work, not advanced artificial intelligence capable of carrying on a sustained conversation. But its effect was still profound. In fact, because test subjects weren’t communicating with another human being, they sometimes felt more comfortable sharing painful, embarrassing, or intimate thoughts.

"When we communicate in an environment with fewer cues from facial expression and body language, people have a lot of room to idealize their partner," says Catalina Toma, an associate professor of communications at the University of Wisconsin. She points to research showing that humans who communicate remotely by email or chat often have an easier time forming personal bonds than people who meet face to face. "It can be hard for real people, with all the messy complications of the physical world, to compete with that."

"Having one-night stands with Androids will happen a lot sooner."

Jonze explores similar themes in Her. "You always wanted to have a wife without the challenges of dealing with anything actually real," scolds one of Theodore's (Joaquin Phoenix’s) former lovers on learning that he’s in a relationship with his operating system. Bonnie Nardi, a professor at the Department of Informatics at the University of California Irvine, says most people today don’t believe they could fall in love with their computer. "They do, however, wish that love could be so simple," she says. "So programmable. So attainable. Computing machines beguile us because we have the dominion to program them."

There is a vast gap, of course, between the kind of artificial intelligence we have today and what is portrayed in Her. And crossing that uncanny valley will be difficult. "Before you can truly fall in love with your computer, you would have to be convinced it understands you and has a mind of its own. The difference between the movie and reality is that right now no machine can sustain the illusion for long," says Gary Marcus, a professor of psychology at NYU who has written extensively on artificial intelligence.

"Computing machines beguile us because we have the dominion to program them."

Professor Marcus believes that less complex intimacies, however, are likely to spring up as we evolve towards that goal of life like artificial intelligence. "People have different relationships with their dogs than they do with fellow humans; there are different kinds of love." As we progress towards more powerful artificial intelligence that can engage at a high level, machines may begin to fill simpler roles as less nuanced companions."It will be awhile before we can have with computers the kind of complex emotional relationship we have with other people, but I imagine people having one-night stands with Androids will happen a lot sooner."

While artificial intelligence may become an increasingly interesting companion — or even lover — there are some who doubt it could ever provide a partner for the deepest form of human love. "While a computer program could provide a captivating virtual romance, just as Eliza was not a bad therapist, we can look to another film, When Harry Met Sally … to tell us why we are still going to pine for the real thing," says Nardi. It boils down to that ultimate human desire, the "I’ll have what she’s having." Nardi explains: "The private intimacy we crave might well issue from interacting with a computer program, but we’ll never be happy with that. We want others to have what we are having, for which the living, breathing man or woman, in all their imperfection and stubborn lack of programmability, is essential."