Pope Francis arrives to lead his weekly general audience in 2016 at the Vatican as people take pictures of him.Alberto Pizzoli / AFP / Getty

ROME—Barely 100 yards away from a statue of Giordano Bruno, the freethinking friar who was burned at the stake in 1600 after the Catholic Church found him guilty of heresy, some of the world’s brightest young people gathered earlier this month for the opening of an unprecedented event: a hackathon convened by the Vatican.

Pope Francis blessed it. Google and Microsoft backed it. Dubbed VHacks, the three-day event welcomed 120 students of different faiths from 60 universities around the world. For the students, the hackathon was a chance to brainstorm new ways of responding to issues that concern the pope: the treatment of migrants and refugees, social inclusion, and interfaith dialogue. For the Vatican, it was also a way to send a message—to students and Silicon Valley alike—that there’s a place for innovation even in an ancient Church.

“I think it’s interesting that the Vatican is taking the initiative on this front because typically it’s not often seen as the most technically forward organization,” said Jake Glass, a 20-year-old Episcopalian student studying science at Georgetown University in Washington, D.C. “They are clearly making an effort right now to do something different and unique.”

The hackathon was just the latest example of the Vatican’s outreach to the tech sector. Under Pope Francis, the Catholic Church has been courting Silicon Valley for years. And these days, Silicon Valley is flirting right back. Both priests and entrepreneurs say a relationship between their two realms, disparate as they are, can be mutually beneficial. Each world has an image problem with which the other can help. And yet each world also arguably has different core values that, in some cases, directly conflict.

The Church has struggled to define and redefine its ambivalent relationship to technology over a period of centuries. In some instances, it has persecuted scientists like Giordano Bruno and, more famously, Galileo Galilei. To this day, it opposes technologies it perceives as hindering human life, whether in the form of contraception and abortion or nuclear weapons. But the Church also has a long history of using science and technology for what it deems to be positive ends. To give just one example, in the 13th century, the Catholic philosopher Ramon Llull developed combinatorial logic and computational theory as part of his quest to teach people about God. Following the motto “ora et labora”—prayer and work—some medieval monasteries became engineering innovation hubs, producing the first known tidal-powered water wheel, impact-drilled well, and other inventions. Engineers have not one but four patron saints in Catholicism. From metallurgy, mills, and musical notation to the wide-scale adoption of clocks and the printing press, Catholics were known innovators—to the point that it’s been argued the Catholic Church was actually the Silicon Valley of the Middle Ages.

“Overall the Church has been very positive toward technology in the past,” said Brian Green, a Catholic professor who focuses on technology ethics at Santa Clara University. “But as humans have become more powerful, the Church has felt like it has to say no to more things,” which gives some the impression that the institution is technologically retrograde. This image poses a threat to the Vatican’s relevance. “Any group that can’t figure out what to do with tech these days is in big trouble,” Green said. “If the Church can’t deal with that in a productive fashion, it’s going to be left behind. So it needs to resurrect its own history of being technologically optimistic.”

Students at work at the Vatican’s hackathon (Courtesy of Major League Hacking)

At the hackathon, Michael Czerny, a Jesuit priest and undersecretary of migrants and refugees in a new Vatican department for promoting human development, said Pope Francis is starting to rectify the Church’s image problem in Silicon Valley. “The owners or controllers of technology would usually not notice the Church,” Czerny said. “Thanks to Pope Francis, they do.”

The pope made global headlines when he met Eric Schmidt, then the executive chairman of Google’s parent company, Alphabet, at the Vatican in January 2016. He met Facebook founder Mark Zuckerberg later that year. Then, in December 2017, the Vatican served as a venue for a tech competition among startups trying to address climate change. The 81-year-old pontiff has freely admitted he doesn’t know how to use a computer, yet he has embraced social media and clocked up well over 40 million Twitter followers. He’s spoken glowingly about the potential of technology to reshape the future—for example, in his 2015 encyclical Laudato Si—but he’s also spoken critically, often in the same breath, about the risk of technological progress coming at the expense of human wellbeing. “How wonderful would it be if the growth of scientific and technological innovation would come along with more equality and social inclusion. How wonderful would it be, while we discover faraway planets, to rediscover the needs of the brothers and sisters orbiting around us,” the pope said in a TED Talk last year.

Czerny seemed to hint at this point of friction when he said, “The first Vatican hackathon has been a great opportunity to increase the platform on which the Church and high-tech can meet—not only to cooperate but also to be mutually honest and, if necessary, critical.” Nearby, Moe Sunami, a 19-year-old Japanese student who attends Harvey Mudd College in California, was designing a website to help teachers support students with disabilities. “I think the focus on doing things that are not necessarily for profit but for social good is what’s absolutely awesome about this event,” she said.

But if the Church is going to support technological progress only insofar as it dovetails with a Catholic view of moral or social good, won’t that hinder some of the profit-seeking entrepreneurs of Silicon Valley? “That’s definitely a tension between the two views,” Green said. “The Catholic Church is fine with capitalism as long as capitalism actually helps people—which is the exception, because capitalism obviously doesn’t always help people.”

Silicon Valley has its share of impact investors and other entrepreneurs who aim to generate a social good as well as financial benefit. Yet Green said that after Donald Trump won the U.S. presidency in November 2016, some of the tech giants have also been taking ethics more seriously. “Since the election, there’s been a lot of soul-searching in Silicon Valley,” he said. Both Twitter and Facebook have publicly grappled this month with the social harm their platforms have enabled, from fake news campaigns to abuse of user data. In the case of Facebook, the blow to the company’s reputation has come with a blow to its bottom line.

A demonstration at the Vatican’s hackathon (Courtesy of Major League Hacking)

Stefano Marzani, a Catholic Italian entrepreneur who directs a company developing software for self-driving cars, agreed there is “no doubt” that Trump’s election changed the tech sector’s mindset. Now, Marzani said, many companies realize they have a lot to gain—reputationally and, ultimately, financially—from associating themselves with the Vatican and other spiritual institutions. “If you’re building a product and you don’t consider ethical values, this has an impact on people, and in the end there’s a very big negative effect,” he said. “We see this emerging here in Silicon Valley. The products are doing well, they have huge profit margins, but the image that these big companies start to have with people—who are feeling like their privacy is not respected—in the end it’s not positive for the companies. So working more on the ethical side of it, it’s a great benefit for the businesses.”

In other words, moral good can sometimes feed into capitalist gain. And plenty of entrepreneurs in Silicon Valley are finding additional ways to profit from spirituality. Marzani noted that spiritual experiences are often mediated through smartphones these days. “Look at the rise of smartphone apps dealing with mindfulness. The huge success of that space is a sign that people need this kind of approach. It’s a market need. Where there’s a need, there’s a possibility of innovation,” he said. “And why should spirituality not be innovated?”

For a religious entrepreneur like Marzani, it makes obvious sense. Asked if he believes that the Church should be more like Silicon Valley or that Silicon Valley should be more like the Church, he replied: “Yes.”

We want to hear what you think. Submit a letter to the editor or write to letters@theatlantic.com.