Halloween is the one day a year where it is perfectly acceptable for grown ass adults to walk around in costumes and consume excessive amounts of candy.

Bring on the sugar, chocolate, and high fructose corn syrup.

But these seemingly simple, delightful confections have a long history of technological innovation.

In honor of Halloween, here is a little glimpse at the tech behind the treats.

Machine-made candy first came about in the 1840s. The first machines were powered by wood-burning and coal-fired candy stoves, and evolved over the years until steam and coal were replaced by gas and electric, and “confectionary machinery” became its own industry.

Historical information from the University of Chicago said that advancements in thermometers and printing also spurred the candy industry, because people could more easily make candy in their homes.

By the mid-1800s, there were over four hundreds factories producing candy in the U.S.

The Food Act of 1906 standardized packaging, and developments in packaging technology meant candy could stay fresh for longer periods of time, which was critical for selling in stores.

Innovation continued over the years, with Reese’s Peanut Butter Cups emerging in 1922, Snickers Bars in 1930, M&Ms in 1941, Starbursts in 1960, Skittles in 1981, and right up until modern day.

Last week for the first time in 30 years, Hershey’s invented a new candy — a caramel candy called the Lancaster.

Yes, it seems like the candy industry and the tech industry have a lot in common.  Success in both fields requires a delicate balance between art and science, both are driven by innovation in ideas and technology, and proper positioning is key.

And both industries have had some epic failures.

Remember the red wax vagina lip candy? Or how about the Circus Peanuts, which are orange colored marshmallows with banana flavor.  Barf. But failure is inevitable when you push the boundaries of what man and sugar can do.

Halloween is now approaching in 2013, and some of the most interesting things happening in Candyland are less about new types of candy, and more about new methods of delivering them, using the Internet as an enabler.

Treatsie is a monthly subscription service for boxes of artisanal candy. Goodies.co, which emerged out of a test from WalmartLabs, was also a monthly snack box of candies, although the company recently shutdown. UNREAL Candy was founded by a teenager and raised “tens of millions” in venture capital, with Khosla Ventures as an investor, for its “natural” alternatives to popular mainstream candies. Sugarfina is an online gourmet candy shop.

I suppose the moral of this story is that kids no longer need to go trick-or-treating. They can have candy delivered to their door.