Dying in a hospital is a new thing. As in, in the trajectory of modern history, it’s only been maybe fifty years since the majority of Americans have spent their final hours or days in a hospital (or hospice or nursing facility) instead of at home.

But before that, when death was an intimate, in-home experience, daily life, including food and eating, was tied up in it.. Not that food isn’t part of today’s funerary customs—most apre-funeral experiences are heaped with food—but these days what we eat is to comfort the living, not to memorialize or save the souls of the dead.

While some of the best funerary rituals in the Western world come from the Victorian era (family photos with a corpse whose eyelids were painted to look like open eyes come to mind), the Victorians were pretty unimaginative when it came to coming up with novel food rituals to accompany their elaborate, macabre remembrances of the dead. Luckily, they were experts at refashioning the rituals of the past to suit their needs.

Take funeral biscuits. Like tiny morbid wedding cakes, these cookies, often decorated with a cross or death’s head, were an essential part of any memorial service. Wrapped in beautifully printed designs and somber Biblical quotes, bakeries did a brisk business in the macabre treat at a time when life expectancy was around 40 years.

But while the Victorians made biscuits a must for a fashionable funeral, they were far from the first to consume sweet treats in the presence of a corpse. That honor goes at least as far back as the “corpse cake,” which was eaten in the Middle Ages in Germany and parts of Central Europe. By leaving the rising pastry dough on the linen-covered chest of the dead body, corpse cakes were believed to absorb the best qualities of the dead, which were then passed on to mourners as they ate.

This was all well and good for those who died virtuously—but what was a mourner to do when the deceased led a life full of sloth, envy, gluttony, covetousness and pride? Only one option: Call the sin eater.

Appearing in England and Wales as far back as the 17th century, sin eaters were a universally reviled but necessary evil. Against the wishes of the church, sin eaters were called in to relieve the deceased of any sins they might be carrying with them into death. Bread placed on the chest of the laid-out body sucked up the sins of the dead, clearing them for passage to heaven. Once the sins had been captured, the sin eater sat on a stool facing the door and ate the bread, taking on the sins as his own, washing them down with a wooden bowl of ale.

There’s no doubt this was a soul-crushing profession. Sin eaters were often homeless wanderers that kept moving through the countryside so as not to be caught and executed by church officials. In public they were social pariahs who were avoided at all costs. Even during the sin-eating ritual they were barely tolerated: when the sin eater’s meal was complete, mourners kicked, punched, and otherwise abused him right out the door to keep the vulgar contents of his belly from contaminating the house. For his efforts, the sin eater made the equivalent of just a few dollars per meal.

Sin eating remained popular in England and Wales all the way until the turn of the 20th century when England’s last sin eater, Richard Munslow, died in Ratlinghope in 1906. In truth, however, sin eating still exists to this day, albeit in a wholly different shape and form. In traditional Chinese funerals, sin eaters consume the iniquities of the dead which are transferred to dishes of dim sum by a religious authority. Across the world, in the Appalachian mountains of the American South, sin eaters still roam the countryside in search of sins to consume...or so the legend goes.

In the West, there’s really one ancient funerary food custom that continues today: consuming something sweet after a funeral. And it’s not just a custom in the West; eating candy, pastries or other sugary foods to purify the living after encountering death is pretty universal, dictated according to cultural norms. In the Middle East and North Africa, the treat of choice since the 5th century has been honey-sweetened halva. In Mongolia, mourners eat a lump of sugar dipped in milk. In Italy, bone- and organ-shaped cookies called “ossi di morti” are served.