Single file compilation
What I always liked about other compilers was the ease to compile simple examples. Just write a C file and call
and the compiler does the rest. Of course when you get to more complex systems you need wp:makefiles and the like, but for a quick test it is very convenient to be able to compile single files.
This mechanism is also available in the new version of EiffelStudio. So when you want to do a quick test, just write your root class and call
The compiler then generates a standard ECF file which you can use to open your class in EiffelStudio. This is very useful if the quick test becomes more complex and you want the power of EiffelStudio for further development.
It is even possible to use some libraries in your example. If you need Vision2 for example, just add a library argument to the commandline:
ec hello_gui_world.e -library vision2
Or if you need multiple libraries:
ec hello_gui_world.e -library vision2 -library gobo
These libraries will be added in addition to the base library. Libraries which are shipped with EiffelStudio can be added by using only the name, for other libraries the full path to the ECF file is needed.
When you do a single file compilation the Eiffel compiler does the following:
- The filename is taken to look for an ecf file with the same name as the class file.
- If it does not yet exist, a new ecf file is generated. It consists of:
- A workbench compilation is done using the ECF file.
- The generated executable is copied into the current working directory.
I believe this mechanism makes it a lot easier to write simple examples in Eiffel by removing the work of writing a configuration file by hand or the need of using EiffelStudio for this.