Getting Started

There is much to do in the first week of EECS3311. Get started right away. Familiarize yourself with Eiffel, the Eiffel method, and Eiffelstudio:

Ensure that you understand and can do the following:

Your first Eiffel program (Hello World)

Whenever you want to get started with a new language (in our case Eiffel) or an Integrated Development Environment (in our case, EiffelStudio), one always tries to run the simplest possible program - one that prints out “Hello World”.

In Java you need

In Eiffel you also need

Here are the contents of hello_world.e:

class HELLO_WORLD create
	make
feature
	make 
		do
			print("Hi World!")
		end
end

Using command line (''ec18.11'')

To compile your program from the command line, use

ec18.11 hello_world.e

On Prism (Linux), we have renamed the command line compiler (“ec”) to '“ec18.11”, as we are using EiffelStudio version 18.11.

[On your own install in Linux/Windows/MacOs, you may be prompted to precompile. Answer Yes.]

On Windows/MacOs, the command line will just be “ec”. On Windows, use the EiffelStudio 18.11 Command Prompt (available from the Start menu).

When you invoke ec on a single source file such as hello_world.e, the compiler will generate the ecf file for you (hello_world.ecf). ECF files specify which libraries will be used. The Base library is always included.

To execute the program:

cd EIFGENs/hello_world/W_code
./hello_world

You can obtain a finalized executable that can be deployed by any user (without the need for the EiffelStudio environment) by:

ec18.11 -c_compile -finalize -config hello_world.ecf

The Eiffel program is translated to C, and the C program is compiled to executable machine code (that does not need a virtual machine to run it). To execute the program:

cd EIFGENs/hello_world/F_code
./hello_world

The above executable should print out “Hi world”. This executable is all you need to run the program on any other Linux machine of the same architecture.

Using IDE (estudio18.11)

You can invoke the EiffelStudio IDE on the above project as follows:

 > estudio18.11 &

(On your own install, it is just estudio).

When you start a new project on the IDE, you can use the Wizard to generate an ECF file automatically. If you already have a project with ECF file foo.ecf, then you can start from the command line as follows:

 estudio18.11 foo.ecf &.

(The ampersand at the end causes the EStudio process to run in the background, leaving the terminal free for further commands.)

eclean script (Prism/VM)

The compiler creates a large number of C and other files that you should get rid off to conserve disk space.

We recommend that you reserve 200MB of free space on your disk for generating the intermediate C files.

If you invoke the Linux command eclean on your directory, the EIFGENs (Eiffel generated files) will be deleted leaving only *.e and *.ecf files.

> eclean .