Project 6: Chef Program
For the past several weeks, we've looked at procedurality as the principle expressive form of computation. But our focus has been on the output of programs. Does code mean more than the programs it runs? Is there a value to code itself?
For this last individual project, you will write a program in the esoteric programming language Chef, designed by David Morgan-Mar. Chef is based on the manipulation of data values in stacks. Variables are named after foods, stacks are called mixing bowls, and instructions are common cooking manipulations. The program itself reads like a recipe (thus the name Chef).
Rules for your completed program:
(1) It must compile and run. It need not be the most meaningful program, but it must execute and do something coherent
(2) It must read like a coherent recipe. That is, the source code should be as readable as the executable code, and it should make sense as a recipe.
(3) If you want an 'A', your recipe must also be coherent enough to be prepared in the real world. This is harder than it sounds.
Extra credit (10! points) for anyone who brings in a version of their Chef code for us to eat in class.
How to program Chef: Chef homepage: http://www.dangermouse.net/esoteric/chef.html.
Pay special attention to the recipe instructions. Sample programs can be found at the bottom of the page. I have provided a sample program I wrote, which executes, is readable, and is also cookable.
The only working Chef compiler compiles chef code to perl. In order to run Chef, you will thus need a Perl interpreter. Windows: get the free download from http://www.activestate.com/ Products/ActivePerl/
Mac: perl comes installed on Mac Next get the chef interpreter from here. Note: do not use the version you find online; it's buggy and I've fixed some of the problems in this one. Also, please note that the new liquefy command does not work in this build; use the deprecated liquify instead.
Follow the instructions to install it. Note that you will have to install it on your own computer; the lab PCs are not equipped with chef interpreters. However you can always run chef programs on the Macs in the lab by opening a terminal window (Applications/Utilities/Terminal).
To run your compiled chef programs, you need to use the perl chef interpreter, e.g. "chef.pl mychefprogram.chef" or "perl chef.pl mychefprogram.chef"
If you are using Mac/Unix, note that you will have to specify a full path to the source file. If the file is in the same directory as the chef.pl file, do "./chef.pl ./mychefprogram.chef". If the file is in the examples folder, do "./chef.pl ./examples/mychefprogram.chef".
If you are using Windows, note that you will have to run perl on the interpreter. If the file is in the same directory as the chef.pl file, do "perl chef.pl ./mychefprogram.chef". If the file is in the examples folder, do "perl chef.pl examples/mychefprogram.chef".
If you want to output text, you should consult this Unicode character table. The small numbers above the letters are the numeric equivalent.