Clean IDE

From Clean
Revision as of 14:35, 5 July 2010 by Bas Lijnse (talk | contribs) (Created page with 'The Clean IDE is the kernel of the Clean System which forms the interface to the programmer and communicates with the other system components. To illustrate what the new IDE look…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Clean IDE is the kernel of the Clean System which forms the interface to the programmer and communicates with the other system components. To illustrate what the new IDE looks like and how to work with it we show on this page what you have to do to compile a simple program, the "Game of Life". The program shown here uses the object I/O library. While we explain what to do to generate an application, we also show you some of the options of the Clean IDE. If you work with the IDE, remember that

The IDE is entirely written in Clean. So, the IDE is also an example of a Clean program, and not a small one either! The 2.0 version of the IDE is currently only available on the Wintel platform. On the other platforms a much more restricted and older version of the IDE is available which is not discussed here.

Making a project and generating an application

Start the Clean IDE (CleanIDE.exe). You see an empty project window. First we have to make a new project (or open an existing project). A Clean program consists of definition modules (.dcl files) and implementation modules (.icl files). A definition module indicates which definitions defined in the corresponding implementation module are exported. The topmost root module (the main module) is always an implementation module.

A openfile.jpg

Open the main module of the "Game of Life" , LifeGameExample.icl (in ObjectIO Examples, Life folder). The source text of this Clean implementation module will be displayed in a text window and can be modified with the built-in editor (see below).

A textwindow.jpg

We now make a new Clean project, which will have LifeGameExample as main module.

A newproject.jpg

Choose "New Project..." and a new project will be made. The project administration needs to be saved in a file (e.g. LifeGameExample.prj). The name of the main module (LifeGameExample) will appear in the project window.

The LifeGameExample uses other Clean modules, namely modules from the StdEnv library and modules from the Object I/O library. Each project has an environment in which it is specified which libraries are being used in the project.

A chooseObjEnv.jpg

The IDE has a couple of popular environments predefined. You have to choose which one you would like to use in this particular project. From the "Environment" menu choose "Object IO". Now the IDE knows which libraries to use in this project.

Environmentpath.jpg

By the way, one can define new environments ("New Environment...") or change existing ones ("Edit Current..."). One can set the libraries to be used, by adding the paths of the folders in which the corresponding Clean source modules can be found. In the environments one can also include "real" libraries containing object code (Static Libraries and Dynamic Libraries). One can even define which IDE components (Tools) to use (which Clean compiler, e.g. version 1.3 or version 2.0 , which linker, and so on). In this way you can easily assign your own preferences to a project or switch from settings just by choosing another environment setting. The environments will be remembered by the IDE, the chosen environment will be remembered in the project administration file.