A tasting menu in seven courses
The Cheffers Cookbook
Learn to write programs that read like recipes — because in Chef, they are recipes.
Chef is a real (if gloriously silly) programming language, invented by David Morgan-Mar in 2002. Every Chef program is a cooking recipe: it has a title, an ingredient list, and a method. Run the recipe and out comes the program's result. The language's official design principles even insist that programs should be “easy to prepare and delicious” — some Chef programs have genuinely been baked and eaten.
The twist: while the recipe reads like dinner instructions, every sentence is secretly a precise computer instruction. Numbers hide in the ingredients, and the cooking steps push them around until something tasty — a message, a calculation, a countdown — lands on the plate.
The kitchen, translated
If you have seen any programming language before, here is the secret decoder ring. If you haven't: even better, you get to learn stacks from a pile of pancakes.
| In the kitchen | In the program |
|---|---|
| An ingredient (“42 g mystery beans”) | A variable — a named box holding one number |
| The mixing bowl | A stack — a pile you can only add to and take from the top |
| The baking dish | The serving tray for output — whatever's in it gets printed |
| The method | The instructions, run one sentence at a time |
Serves 1. | “Print the result” — no serving, no output! |
| The refrigerator | Input — where numbers you type come from |
| A sous-chef | A function — a helper recipe you can call |
How to use this cookbook
Keep the Cheffers Playground open in another tab. It runs the real interpreter right in your browser — nothing to install, nothing sent to a server. Every recipe in this book has an Open in playground button that loads it straight into the editor, ready to run and mess with. And please do mess with them: the “Try it” boxes at the end of each course are where the real learning happens.
The courses build on each other, so going in order is the easiest path. If you ever forget what an instruction does, the Pantry Reference lists every one of them on a single page.
Tonight's menu
Because it's a joke with excellent ingredients. Under the aprons, Chef is built on the same ideas as serious languages: variables, stacks, integer math, loops, input and output, and function calls. Learning them here — where a stack is literally a pile of pancakes — makes them much easier to recognize everywhere else.