ARCANE PROGRAMMING LANGUAGES
Arcane Programming: Chef
Last week I covered the unique visual programming language, Piet, which is a true feast for the eyes. This week I’m talking about Chef another programming language created by David Morgan-Mar but this one might be a treat for the tastebuds.
The History of Chef
Chef was designed to challenge the norms of programming languages by presenting code in the form of cooking recipes. Its cooking-themed structure is no mere garnish: the language’s design enforces a syntactic metaphor of cooking throughout, producing code that reads like a recipe, complete with ingredients (variables), methods (operations), and serving suggestions (output).
In the broad kitchen of esoteric languages, Chef stands out as a hearty dish of creativity. While it certainly has no practical application, it offers a unique perspective on code, transforming the traditionally technical task of programming into an exercise of imaginative culinary writing.
Syntax and Architecture
When you write a program in Chef, you’re not just coding — you’re crafting a culinary masterpiece. Each Chef program is a “recipe” complete with a title, a list of “ingredients” (variables), and a set of “cooking instructions” (operations). Chef employs a unique type of strong static typing where variables can be integers, real numbers, or strings, but are referred to as ‘dry’ or ‘liquid’ ingredients.
As is the case in a real kitchen, the order of operations matters. You list your ingredients, then follow the recipe method. Variables are initially “put into mixing bowls” or “mixed,” and the bowls can be “combined,” “divided,” “added,” or “removed” to carry out operations. Despite this strange metaphor, Chef actually is Turing complete, meaning it can solve any computational problem, given enough time and resources.
It is even possible to write programs in Chef that are both valid executable programs and real recipes that can be made in the kitchen. Mike Worth created a program, “Hello World Cake with Chocolate sauce”, which can be used to bake a cake with chocolate sauce even if it is a little strange.
From my personal experience of coding in Chef, I found it to be humorous, and challenging, and at times made me a bit hungry. The verbosity of the language and the indirect mapping of culinary verbs to programming concepts meant that writing even simple programs could become quite complex.
The Future of Chef
Like most esoteric languages Chef is not well suited for most programming tasks. Chef is unlikely to find a place in mainstream programming or replace conventional languages for general computing tasks.
However, Chef could offer significant educational value. Its unique metaphor-based design can make programming concepts more approachable for beginners by contextualizing them in a familiar setting.
After spending some time with Chef, I’ve come to appreciate this delectable blend of coding and cooking, even if it’s a dish best served in moderation.
This article is just part of an ongoing series on Arcane and Esoteric programming languages. Follow me if you want to see more.
I write on a wide variety of topics including programming, travel, politics, books, and AI. You can see all of my stories on Medium here.
If you like my stories on Medium, you can subscribe here to get them directly in your inbox. That way you’ll never miss one!
You can also support other authors and me by joining the Medium community. Sign up for a membership using this link. For only $5 a month, you get unlimited access to all the stories on Medium and I also get a small commission at no extra cost to you.
(Some of the links in my articles may be affiliate links for which I might receive a small commission.)