Twinkies, the unpretentious, freakishly versatile and seemingly indestructible snack pastry dubbed “the cream puff of the proletariat,” died Friday of complications from economic reality.

Texas-based Hostess Brands announced it would shutter operations amid a debilitating labor dispute. Twinkies were 82.

Although they pre-dated the Baby Boom, Twinkies became a lunchtime staple for post-World War II generations of schoolchildren — something to take the sting off the bologna sandwich and the dutiful apple.

Hostess Brands, pop culture scholar Robert Thompson said, eventually covered all the lunchbox food groups, including Wonder Bread, the Ding Dong and the Ho Ho. And the ascendancy of the Twinkie represented how “food had become technology,” Thompson said. “A pastry with filling, wrapped in cellophane.”

More than that, Twinkies have lodged themselves into the cultural firmament for better and worse.

Twinkies have provided countless yuks in movies. They were a vaguely effeminate doughnut substitute for cops (“They’re for my wife”) in “Die Hard” (1988). In the Pixar animated film “WALL-E” (2008), which is set 700 years in the future, the only surviving species is the cockroach, and his favorite food is an abnormally fresh Twinkie. (Folklore aside, a Twinkie’s shelf life is about two to three weeks.)

Twinkies are a notorious footnote in the country’s judicial system. An attorney for San Francisco Supervisor Dan White argued in 1979 that his client should not be convicted of first-degree murder because of diminished mental capacity from eating so much junk food that it exacerbated his depression.

The so-called “Twinkie Defense” did not help White, who was convicted of voluntary manslaughter in the killings of Mayor George Moscone and Supervisor Harvey Milk.

The Twinkie was born in 1930 and is often credited to James Dewar, a Illinois baker for what was then Continental Baking. The firm produced a cream-filled strawberry shortcake and, when strawberry season was over, he saw no reason the machines needed to sit idle. He formulated a banana cream cake which, amid World War II rationing, became and remained vanilla cream.

The name? It was inspired by a billboard Dewar saw for Twinkle Toe Shoes. “I shortened it to make it a little zippier for the kids,” Dewar said in a 1980 interview.

The golden confection developed into a finger-shaped sugar sponge that was injected with a gooey filling capable of turning small children into google-eyed rocket boosters.

Hostess reportedly sells about $2.5 billion annually of baked goods; seriously, not extruded but baked — “just like your mother used to,” as the company once wrote to a skeptical customer.

Twinkies have survived the Depression, three major wars, the crumbling of the Berlin Wall, bankruptcy filings by the parent company, and all the jokes about their post-apocalyptic staying power. But ultimately, Twinkies were vulnerable to labor problems at Hostess, which is now privately owned by two hedge funds.

The company argued that crippling wage and benefit disputes were its ruin and left it hundreds of millions of dollars in debt. The striking Bakery, Confectionery, Tobacco Workers and Grain Millers International Union blamed lackluster technological investment by Hostess and a focus on profits for the hedge funds. Either way, 18,500 people are out of a job, and an iconic product will cease production unless another firm scoops up the brand.

Several of the company’s most popular brands are likely to be reincarnated if Hostess wins court approval to liquidate early next week. “We will pursue an extensive asset sale, which will include the sale of our brands,” company spokesman Erik Halvorson wrote in an email.

Like a Twinkie, news of its potential demise seemed for many almost too much to digest. They were already retailing on eBay for $100 for a box of 10, and news of Twinkie hoardings proliferated in Washington and around the country.

Roland Mesnier, a French native who served as White House pastry chef for 25 years, is perhaps the opposite of someone you’d think would care about Twinkies.

“I do care,” he said. “I care that so many people are losing their jobs. Twinkie is not a bad product. There’s worse products out there. Twinkies are as much an American icon as Ford motor vehicle or other American ingenuity.”

His opinion of the food itself: “The cake is quite nice, but the cream is questionable.” He sent the company ideas to re-energize the Twinkie. “How about having a Twinkie with different citrus cream inside — lime, orange, lemon, with pretty packaging, cheerful and colorful?” he said. “Or what’s wrong with a chocolate Twinkie? Of course, I never heard back.”

As an adviser to a Chinese company making snack foods, Mesnier was mostly impressed with the consistency of Twinkie quality reproduction. But appreciation of technology can’t override dietary trends of aging, red-meat-shunning Baby Boomers to whom Twinkies are but a wistful high-fructose memory.

“The people who most mourned the death of the Twinkie are probably those who learned to quit eating them a long time ago,” said Thompson, who is 57 and admits a fondness for Pennsylvania-based rival Tastykake.

Twinkies came back to the brink of food relevance about a decade ago when a transplanted Briton named Christopher Sell opened an eatery in Brooklyn called the Chip Shop.

“We were credited with frying the first Twinkie — that’s my claim to fame,” said Sell, who is 47. “Maybe it will not be on my tombstone anymore. We did it as a joke just because. ‘Deep-fried Twinkie? Who the hell deep-fries a Twinkie?’ We put things on the menu from time to time just to get a reaction.”

It was a hit, and a food writer covered the excitement for The New York Times. Sell began getting calls all over the country from state fair officials who wanted to learn how best to deep-fry a Twinkie.

Sell considers the Twinkie to be a “clammy cold cake” but asked to describe its appeal deep-fried, he became nostalgic. “When you’re a kid, you remember your mother bringing the cake out of the oven,” he said. “A deep-fried Twinkie brings it back to that level. Freshly baked cake that is fried in slightly salty batter. The salt cuts the sweetness. The Twinkie was destined for the fryer.”

He sells maybe 150 a week at his two Brooklyn shops, for $3.50 each. Tonight, he said, he will defrost three of the Twinkies he keeps in his freezer and serve them to his family. Another one he might freeze-dry and frame as “memorabilia” to show his future grandchildren.

“Let’s face it,” he added. “The whole concept of a Hostess-type product is doomed anyway. My kid can’t eat a mouthful of it. We try to give our kids the best we can, and the Twinkie ain’t that.”

But as Thompson said, food is not just about nutrition, but also is about biography, childhood history and habits and cellophane-wrapped customs. “Why can’t the apple go out of business and the Twinkie be manufactured?” he asked.

Depending on a willing Hostess buyer, survivors may not include Ding Dongs, Ho Hos, Sno Balls, Donettes and bread lines such as Wonder and Nature’s Pride.

In lieu of flour, doughnations may be made to the organization of your choice. Consider the American Diabetes Association.