Get Started

The language manual can be found at the Manuals and Supportpage of the Clean website.

The Clean compiler can be found here. Please register, as requested, though it is not necessary (you can click on "Download clean" on the left.) The .7z package is the quickest to download for Windows programming, if you have 7-zip. Then, get Part I of Functional Programming in Clean; get the 1-up PDF version if you plan to study from the computer.

Unzip the package in the directory of choice, and start the Clean IDE. It will ask to integrate into your operating system (basically, be put into the registry so Windows recognizes it exists); click "Yes." To make a "hello world" program, select File->New File and select a file name, in this case "hello.icl". The file name MUST be the same as the module name. Then, type:

module hello import StdEnv Start = "Hello, world!"

The name after "module" must even be the same case as the name hello.icl; Clean is case sensitive, i.e. "start =" doesn't work, while "Start =" does. "import StdEnv" loads the standard library, and is required in every Clean program; other libraries can be loaded as needed. The two top lines are implied in Clean source code seemingly lacking them. "Start =" defines what is actually executed.

Now a project must be made. Select File->New Project, and name your project hello.prj, only that will work. After that, click on the hello.icl window (where the source code is) so that it is active, and select Project->Set Main Module. Now, on the toolbar, select the Update and Run icon (it looks like a window flying to the right.) It will create a DOS terminal with "Hello, world!" displayed. Press any key to exit.