Consider the early 19th Century Italian Giacomo Leopardi. Known chiefly for his exquisite verse, Leopardi was also a highly original thinker, who in his Zibaldone - a "hodge-podge of thoughts", some 4,500 handwritten pages long - produced a penetrating analysis of modern life. Brought up in a small hill-town to be a good Catholic by his father, an old-fashioned country nobleman who still wore a sword, Leopardi became an atheist in his teens.
For Leopardi, the universe was made of matter that obeyed physical laws. Humans were animals that had come into the world and acquired self-awareness by chance. Writing before Darwin, he didn't acquire this view of things from science, but from reading the classics and observing the life around him. Leopardi never renounced this uncompromising materialism. But at the same time he defended religion, which he regarded as an illusion that was necessary for human happiness.
If the modern world rejected traditional faiths, Leopardi believed, it would only be to take up others that were more harmful. He was not particularly fond of Christianity, whose claim to be a revelation for all of humankind he believed had led to intolerance. "Man was happier before Christianity," he wrote, "than after it". But the alternative to Christianity, in modern times, was what he called "the barbarism of reason" - secular creeds like Jacobinism in revolutionary France, which aimed to remake the world by force. These political religions would be even more intolerant than Christianity, Leopardi believed, and if you consider the history of the 20th Century, he was surely right.
Leopardi favoured the Catholicism in which he'd been brought up as the best available illusion. But he didn't return to religion himself. He spent his short life - born in 1798, he died in 1837 - reading and writing, acquiring short-sightedness and a hunchback from spending so much time in his father's library. Sickly and poor most of the time, his principal human attachments were with a married woman and a male friend in whose house he died. He didn't share the illusions he believed were necessary to happiness, and much of his poetry has a melancholy tone. Yet he doesn't seem to have to been unhappy. His final hours were spent tranquilly dictating the closing lines of one of his most beautiful poems.