Cool Overview

Cool is a Classroom Object-Oriented Language — it is essentially a small subset of Java. It's small enough to be manageable for semester projects but large enough to help you to learn all of the concepts and to write non-trivial programs.

(* hello-world.cl *)
class Main inherits IO {
  main() : Object {
    out_string("Hello, world.\n")
  } ;
} ;

Cool Reference Manual

The Cool programming language is formally specified and defined in The Cool Reference Manual, a document that you will grow to love (or hate) over the course of this semester. Multiple versions are available:

Your submissions will be judged based on the material in the "Classic" version of the CRM. While every effort has been made to make the "Modern" version identical, some transcription errors may occur. The course staff may not have the time to continuously update the "Modern" CRM as typos are discovered.

Cool Reference Compiler

Different versions of the reference interpreter are available for different platforms. Information on running the interpreter is available in the reference manual.

Cool Interactive In-Browser Debugger

An interactive in-browser debugger for Cool is available. This debugger allows you to load and save Cool programs (and inputs to Cool programs), set breakpoints, inspect the values of local variables, inspect stack traces, and otherwise explore Cool execution.

Special thanks to alumni Chris Earman and Zane Mayberry for providing this debugger. Any attempt to reverse engineer the Cool Debugger is a violation of the Honor code. (This is different from the reference compiler, which you are welcome to try to take apart.)

Additional Support

There is Cool syntax highlighting support for Vim.

If you like XEmacs, the Berkeley Harmonia project has a Cool mode. It offers quite a bit more than syntax highlighting, but not all of the semantic features are guaranteed to be compatible with our dialect of Cool.

The Sublime text editor supports Cool syntax highlighting.

The Atom text editor has a student-written Cool language syntax highlighter.

An easy-to-script implementation of Delta Debugging is available, written by Daniel S. Wilkerson and Scott McPeak. (local mirror)