Chef ist eine stapelbasierte esoterische Programmiersprache, deren Programme wie Kochrezepte aussehen. Finden Sie mehr rund ums Programmieren auf unserer Schwerpunktseite Programmiersprachen.
Geschichte
Entworfen hat Chef David Morgan-Mar im Jahr 2002. Laut seiner Website war Chef Teil der zweiten Runde der MIT Mystery Hunt 2002. Am Georgia Institute of Technology gehörte die Sprache ab dem Herbstsemester 2005 zu einer Einführungsveranstaltung in Computational Media.
Funktionsweise
Ein Chef-Programm besteht aus einem Rezepttitel, einer Zutatenliste, deren Mengen die Datenwerte sind, und einer Zubereitung mit Anweisungen, die Rührschüsseln und Backformen als Stapel benutzen. Die Gestaltungsgrundsätze laut Morgan-Mar: Rezepte sollen nicht nur eine gültige Ausgabe erzeugen, sondern auch leicht zuzubereiten und köstlich sein; sie sollen verschiedene Budgets ansprechen und metrisch sein, dürfen aber auch Tassen und Esslöffel verwenden.
Hello World
Morgan-Mars eigenes Beispiel „Hello World Souffle“ erzeugt zwar die richtige Ausgabe, ist aber laut Esolang-Wiki weder leicht zuzubereiten noch köstlich. Mike Worth schrieb später ein Hello-World-Programm, das sich als Schokoladenkuchen tatsächlich backen lässt:
Hello World Cake with Chocolate sauce.
This prints hello world, while being tastier than Hello World Souffle. The main
chef makes a " world!" cake, which he puts in the baking dish. When he gets the
sous chef to make the "Hello" chocolate sauce, it gets put into the baking dish
and then the whole thing is printed when he refrigerates the sauce. When
actually cooking, I'm interpreting the chocolate sauce baking dish to be
separate from the cake one and Liquify to mean either melt or blend depending on
context.
Ingredients.
33 g chocolate chips
100 g butter
54 ml double cream
2 pinches baking powder
114 g sugar
111 ml beaten eggs
119 g flour
32 g cocoa powder
0 g cake mixture
Cooking time: 25 minutes.
Pre-heat oven to 180 degrees Celsius.
Method.
Put chocolate chips into the mixing bowl.
Put butter into the mixing bowl.
Put sugar into the mixing bowl.
Put beaten eggs into the mixing bowl.
Put flour into the mixing bowl.
Put baking powder into the mixing bowl.
Put cocoa powder into the mixing bowl.
Stir the mixing bowl for 1 minute.
Combine double cream into the mixing bowl.
Stir the mixing bowl for 4 minutes.
Liquefy the contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
bake the cake mixture.
Wait until baked.
Serve with chocolate sauce.
chocolate sauce.
Ingredients.
111 g sugar
108 ml hot water
108 ml heated double cream
101 g dark chocolate
72 g milk chocolate
Method.
Clean the mixing bowl.
Put sugar into the mixing bowl.
Put hot water into the mixing bowl.
Put heated double cream into the mixing bowl.
dissolve the sugar.
agitate the sugar until dissolved.
Liquefy the dark chocolate.
Put dark chocolate into the mixing bowl.
Liquefy the milk chocolate.
Put milk chocolate into the mixing bowl.
Liquefy contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
Refrigerate for 1 hour.
Einordnung
Chef gehört zu den Sprachen mit einem Thema außerhalb der Informatik, so wie Shakespeare. Von Morgan-Mar stammen auch Piet, Ook! und HQ9++. Weitere Sprachen finden Sie in unserer Liste: Esoterische Programmiersprachen.
Quellen
Stand: 15.10.2026
