Chef (programming language)

Chef (programming language)

Chef is an esoteric (or joke) programming language designed by David Morgan-Mar. It is based on the manipulation of data values in a number of stacks; the same idea is used in assembly programming languages. Each program consists at minimum of the following:

  • A title
  • A list of variables and their data values
  • A list of instructions for stack manipulation

The joke is that the variables tend to be named after basic foodstuffs, the stacks are called 'mixing bowls' and the instructions for manipulating them 'mix', 'stir', etc.. A program, then, reads much like a cooking recipe.

A Hello World example program in Chef:

 Hello World Souffle.
 
 Ingredients.
 72 g haricot beans
 101 eggs
 108 g lard
 111 cups oil
 32 zucchinis
 119 ml water
 114 g red salmon
 100 g dijon mustard
 33 potatoes
 
 Method.
 Put potatoes into the mixing bowl.
 Put dijon mustard into the mixing bowl.
 Put lard into the mixing bowl.
 Put red salmon into the mixing bowl.
 Put oil into the mixing bowl.
 Put water into the mixing bowl.
 Put zucchinis into the mixing bowl.
 Put oil into the mixing bowl.
 Put lard into the mixing bowl.
 Put lard into the mixing bowl.
 Put eggs into the mixing bowl.
 Put haricot beans into the mixing bowl.
 Liquefy contents of the mixing bowl.
 Pour contents of the mixing bowl into the baking dish.
 
 Serves 1.

The phrase "Hello world!" is encoded as ASCII values in the amount specifiers in the recipe. The ingredient names themselves are variable names, and are here named with a starting letter matching the letter encoded in the number in front for convenience, except that zucchini is the space and potatoes are the exclamation point.

The order of the words is reversed because when the phrase "hello world!" is printed out, the ingredients are "popped" from the stack (also known as the mixing bowl). The last element (last ingredient) to be put in the stack is the first element out of the stack.

A Fibonacci example program can be found on the language's website.

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Shakespeare (programming language) — The Shakespeare Programming Language (SPL) is an esoteric programming language designed by Jon Åslund and Karl Hasselström. [ [http://shakespearelang.sourceforge.net/report/shakespeare/shakespeare.html The Shakespeare Programming Language] ] Like …   Wikipedia

  • Esoteric programming language — An esoteric programming language (sometimes shortened to esolang) is a programming language designed as a test of the boundaries of computer programming language design, as a proof of concept, or as a joke. There is usually no intention of the… …   Wikipedia

  • Shakespeare Programming Language — Die Shakespeare Programming Language (SPL) ist eine von Kalle Hasselström und Jon Åslund im Jahre 2001 entwickelte imperative esoterische Programmiersprache (Computersprache), welche in C realisiert wurde und zu den am schwersten erlernbaren… …   Deutsch Wikipedia

  • Chef (disambiguation) — A chef is a person who cooks professionally. Chef may also refer to: Chef (baking), a bread starter Chef (programming language),an esoteric programming language designed by David Morgan Mar Chef (software) is an open source configuration… …   Wikipedia

  • List of programming languages by category — Programming language lists Alphabetical Categorical Chronological Generational This is a list of programming languages grouped by category. Some languages are listed in multiple categories. Contents …   Wikipedia

  • List of programming languages — Programming language lists Alphabetical Categorical Chronological Generational The aim of this list of programming languages is to include all notable programming languages in existence, both those in current use and historical ones, in… …   Wikipedia

  • Language internaute — Jargon informatique Le jargon informatique est un pseudo langage propre aux représentants des professions gravitant autour de l informatique. Discutant essentiellement par messages courts, ces personnes utilisent en excès des abréviations,… …   Wikipédia en Français

  • Weird Programming — Esoterische Programmiersprachen sind Programmiersprachen, die nicht für den praktischen Einsatz entwickelt wurden, sondern ungewöhnliche Sprachkonzepte umsetzen. Eine einfache Bedienung ist selten, teilweise werden Sprachen konzipiert, um… …   Deutsch Wikipedia

  • Channel 4 programming — Channel 4, in common with the other main British stations broadcast on analogue, airs a highly comprehensive range of programming. It was established in 1982 with a specific intention of providing programming to groups of minority interests, not… …   Wikipedia

  • EXtensible Markup Language — Extension de fichier .xml Type MIME application/xml, text/xml Développé par World Wide Web Consortium Type de format …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”