Mac and cheese must be for many the quintessential comfort food.
Pairing pasta with cheese in a casserole has been recorded in cookbooks since the 14th century. A French dish of Parmesan cheese and pasta was brought to England in the 14th century. It was made with fresh, hand-cut pasta, which was sandwiched between a mixture of melted butter and cheese. The recipe given in the language of the day was:
"Take and make a thynne foyle of dowh and kerve it on peces, and cast hem on boillyng water & seeæ it wele. Take chese and grate it and butter cast bynethen and above as losyns and serue forth."
-- The Forme of Cury: A Roll of Ancient English Cookery Compiled, about A.D. 1390
The famous Mrs. Beeton in her Book of Household Management (1861) included two recipes for the dish.
"The macaroni, (which should be "tender but perfectly firm, no part being allowed to melt, and the form entirely preserved" -- lest one be tempted to cook it for so long it actually disintegrated) is then topped with more cheese, pepper and breadcrumbs, before receiving a final dose of melted butter for good measure and being placed before a 'bright fire' to brown the crumbs, or grilled with a salamander."
This would be the recipe for the purists, but I much prefer the second one of which the recipe below is derived and made with a cheese sauce.
Your variation with mac and cheese is limited only by your imagination and multiplied by the varieties of cheese.
Mac with Caramelized Onion and Smoked Cheese
500 g (1.1 lb) macaroni
45 ml (3 tbsp) olive oil
750 g (1 2/3) onion, halved and thinly sliced
15 ml (1 tbsp) brown sugar
45 ml (3 tbsp) balsamic vinegar
For the Bechamel sauce
50 g (1/4 cup) butter
60 g (1/2 cup) all-purpose flour
625 ml (21 oz) milk (warmed)
Salt and pepper to taste
150 g (51/4 oz) smoked grated Gouda cheese
150 g (51/4 oz) grated cheddar
250 ml (1 cup) fresh bread crumbs
1. Cook the macaroni in salted water until tender.
2. Heat the oil in a large frying pan, add the onions and cook over high heat until brown and caramelized. About 15 minutes.
3. Add the vinegar and sugar. Stir until almost dry.
4. Season with salt and pepper and remove from the heat.
5. Make the Bechamel by melting the butter, stirring in the flour and gradually the warmed milk.
6. Remove from the heat and fold in the grated cheese and seasoning.
7. In a large bowl mix the macaroni, onions and Bechamel sauce.
8. Transfer to a baking dish, smooth the top and sprinkle with the bread crumbs.
9. Grill for 5 to 10 minutes until top is crunchy and golden brown.
10. Serve immediately.