Description #
Chef is an esoteric programming language where programs are written to resemble cooking recipes. Ingredients become variables, cooking steps perform operations, and the final “serving” represents program output. It blends humor with logic in a format that’s readable both as code and as a recipe.
History #
Chef was created in 2002 by David Morgan-Mar. It was inspired by the idea that code could be beautiful, artistic, and funny. The design goals were to make code look like an actual recipe, have it compile and run correctly, and even taste like a plausible meal.
Hello World Code #
Hello World Souffle.
Ingredients.
72 g haricot beans
101 g zuchinni
108 g carrots
111 g turnips
32 g potatoes
87 g cabbage
114 g onions
100 g garlic
33 g pepper
Method.
Put haricot beans into mixing bowl.
Put zuchinni into mixing bowl.
Put carrots into mixing bowl.
Put carrots into mixing bowl.
Put turnips into mixing bowl.
Put potatoes into mixing bowl.
Put cabbage into mixing bowl.
Put turnips into mixing bowl.
Put onions into mixing bowl.
Put garlic into mixing bowl.
Put pepper into mixing bowl.
Serves 1.
How to Run #
Option 1: Online
Option 2: Local
- Install a Chef interpreter:
- Save code in a
.chef
file - Run:
./chef hello.chef
Key Concepts #
- Ingredients = variables (must be edible items)
- Mixing bowl = stack memory
- Actions like “mix” or “fold” = arithmetic operations
- Serve = output
- Method section = control flow and logic
- Serves = how many outputs to display
- Cooking verbs map to computational behavior
- Whitespace-sensitive structure
- Code must also look like a real recipe
- Variables are implicitly typed by quantity
Try It Online #
Fun Facts #
- Chef code is expected to compile and resemble an actual meal.
- Multiple programs have been written that are both functional and edible-sounding.
- Chef encourages poetic and culinary creativity in code form.