Compilation Without Configuration

Revision as of 16:52, 8 August 2007 by Bertrand Meyer (Talk | contribs)

Warning: To adhere to the standards for the Projects category, this project page should include a "Project members" section listing contributors and means to contact them. Please add this information, then remove the present notice.


Preamble

It would be nice if we could provide a mechanism for compiling a system without first providing a configuration file to the compiler. This would be useful for compiling simple samples such as 'Hello world!' without having to supply a configuration file. Not only would this remove the need to keep the configuration file always up to date with the latest compiler (LACE -> ECF) but it would make samples easier to write as you don't have to explain the configuration process or the wizard process. All that needs to be done is to copy and paste the class file in to a text file and compile the text file. Or you could even write a simple example and compile it totally from scratch via the command line, something which is extremely difficult to do now without the use of EiffelStudio.

Potential Solutions

  • The default way: ec -root_class my_root_class.e 'my_root_class.e' would have either a make or default_create routine defined in it. The compiler would then compile the system against either a precompiled base or compile against base if a precompile is not available. The compiler would look in $ISE_LIBRARY/library/base to find the configuration file. The compiler would use the directory (and possibly all child directories) of the root class as the root cluster.
  • The indexing clause way: Starts off by compiling the ec my_root_class.e but looks for the libraries based on a tag in the indexing clause (such as libraries: "base, vision2, thread"), if would also look in the $ISE_LIBRARY path to find the associating libraries, which will be associated via name rather than ecf path. This would require initial lexing of class files (or just the root class) to retrieve the libraries: indexing clause.
  • The command line switch way: The user would have to supply the libraries needed as a command line switch (ec -libraries base vision2 -root_class.e)

Things to consider

  • Do we keep the compilation output or default to a finalization, clean up and then copy the generated binary to the location of the root class? We could also have a -keep_object_code which would't delete the EIFGEN output so that it could be incrementally compiled.
  • Should EiffelStudio compile a system from scratch if we double click on a class by using this default option?


It is not intended to be a do all mechanism, just a simple way to compile an Eiffel system with just a class file, as is possible in other languages.