You can easily compile and run your own Cecil and Diesel programs on UW CSE research and instructional machines running Linux or MacOS X. You also can use Cecil and Diesel on Windows, as described towards the end of this page.
If you want to run Cecil or Vortex on a Linux, MacOS X, Windows, or other Unix-like machine outside the department (i.e., outside the department's trusted subnetwork that allows access to /cse/courses/misc_lang/vortex), then read the instructions in /cse/courses/misc_lang/vortex/REMOTE/README.
For small experimentation with simple Cecil code, the Cecil evaluator is a fine option. First, log in to an instructional or research Linux or MacOS X machine. Then run the Cecil evaluator by executing /cse/courses/misc_lang/vortex/run-cecil. At the Cecil> prompt, enter expressions you'd like to evaluate. You can invoke any methods and instantiate any objects from the Cecil standard library. You also can define your own objects, methods, fields, and variables. You can write Cecil code in separate files, and then evaluate the contents of those files using Cecil include declarations. (Cecil mode for emacs is available below.) The evaluator will perform typechecking of any expressions or declarations you enter. It's even possible to redefine methods and fields; duplicate declarations of variables and objects will be ignored. Note, however, that the Cecil evaluator's performance is relatively poor. Some additional information is available in /cse/courses/misc_lang/vortex/notes/QUICK-START-CECIL; $VORTEX_HOME in that file refers to /cse/courses/misc_lang/vortex. Cecil manuals are available below.
For small experimentation with simple Diesel code, the Diesel evaluator is a fine option. First, log in to an instructional or research Linux or MacOS X machine. Then run the Diesel evaluator by executing /cse/courses/misc_lang/vortex/run-diesel. At the Diesel> prompt, enter expressions you'd like to evaluate. You can invoke any functions and instantiate any classes from the Diesel standard library. You also can define your own modules, classes, functions, methods, fields, and variables. You can write Diesel code in separate files, and then evaluate the contents of those files using Diesel include declarations. (Diesel mode for emacs is available below.) The evaluator will perform typechecking of any expressions or declarations you enter. It's even possible to redefine functions, methods, and fields; redeclarations of variables and classes will be ignored. Note, however, that the Diesel evaluator's performance is relatively poor. Diesel manuals are available below.
For larger programs, the Vortex compiler is the best tool. Vortex is an optimizing compiler for Cecil and Diesel, as well as several other object-oriented languages including Java and (in the past) C++, Modula-3, and Smalltalk. (The Vortex compiler includes the functionality of the Cecil evaluator, too, so if you start up Vortex, you can do all the things at the Vortex> prompt that you could do at the Cecil> prompt.)
To compile a Cecil or Diesel program using Vortex, follow these steps (look at the How to Use the Vortex Compiler manual for more information, or look at /cse/courses/misc_lang/vortex/notes/QUICK-START-VORTEX; $VORTEX_HOME in that file refers to /cse/courses/misc_lang/vortex):
There is a lot of Cecil and Diesel code to look at for examples. It's all under /cse/courses/misc_lang/vortex/{Cecil,Diesel}/src. You may be interested in looking at the following subdirectories: Cecil/src/benchmarks/tiny, Cecil/src/contrib, Cecil/src/stdlib (sources for the standard library except the evaluator), and Diesel/src/stdlib. The Vortex compiler source code is in the Cecil/src/compiler subdirectory. The Whirlwind compiler source code is in the Diesel/src/whirlwind subdirectory. Cecil and Diesel modes for emacs are available below.
The way the evaluator prints out values is by sending them the print_string message. By convention, this message returns a string that's a printable representation of its argument, but does not print anything itself. The debugger then prints that string out. So if you define new kinds of objects/classes in your program, you may also want to define the print_string methods so they print out nicely. Here's an example (in Cecil syntax; Diesel replaces @: with @):
method print_string(p@:pair[`A,`B]):string { "(" || p.first.print_string || "," || p.second.print_string || ")" }
Remember that the debug> prompt is printed by your running program (and this is the place to add new methods and evaluate expressions), while the Vortex> prompt is printed by the compiler, and you should only issue compiler commands (like make) at that prompt unless you're debugging Vortex itself.
If you want to run the Cecil or Diesel interpreter on a UW CSE Windows machine, you can use the standard Windows command window and just invoke the interpreter directly:
> o:\cse\courses\misc_lang\vortex\Cecil\bin\winnt\cecil
or
> o:\cse\courses\misc_lang\vortex\Diesel\bin\winnt\diesel
(This assumes that your o: drive is mapped to \\ntdfs\cs, which is the default for CSE machines.)
If you want to run the Vortex compiler, then you need to set things up a bit first:
Look at the following for details about Cecil, Diesel, and Vortex:
To use them, put them in some directory, e.g. ~/emacs, and then add lines like the following to your ~/.emacs file:
(setq load-path (cons (expand-file-name "~/emacs") load-path)) (autoload 'cecil-mode "cecil-mode" "Cecil mode" t) (autoload 'diesel-mode "diesel-mode" "Diesel mode" t) (setq auto-mode-alist (cons '("\\.cecil$" . cecil-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.diesel$" . diesel-mode) auto-mode-alist))
For more info consult the Cecil/Vortex Home Page.