User Tools

Site Tools


eiffel:hello:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
eiffel:hello:start [2017/01/08 03:26]
jonathan
eiffel:hello:start [2018/12/28 20:49] (current)
jackie [Your first Eiffel program (Hello World)]
Line 1: Line 1:
-===== Your first Eiffel program =====+====== 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:​ 
 +  * Execute a "Hello World" program using the command line compiler. Instructions below.  
 +  * Quick introduction to Eiffel Syntax [[http://​www.eecs.yorku.ca/​~eiffel/​eiffel-guide/​|here]] 
 +  * Learn how to use the EiffelStudio IDE [[:​eiffel:​hello:​hello2:​|here]] (using class CALENDAR). This also introduces you to some design principles.  
 +  * Run the unit testing framework ESpec, instructions [[:​eiffel/​espec/​start|here]] 
 +  * See the sequence of Videos introducing EiffelStudio,​ ESpec and using the debugger [[https://​wiki.eecs.yorku.ca/​project/​eiffel/​videos:​start|here]]. 
 +  * Read/​Understand [[https://​wiki.eecs.yorku.ca/​project/​eiffel/​_media/​getting_started:​eiffel-essentials.pdf|Eiffel Essentials -- The Language and Method]] (24 pages) 
 + 
 +Ensure that you understand and can do the following:​ 
 + 
 +  * Basic Eiffel Syntax and Method 
 +  * Compile and execute from the command line 
 +  * Start a new project in the EiffelStudio IDE 
 +  * Change the settings to Void Safety mode 
 +  * Browse clusters, classes and features (contract view, flat view etc.) 
 +  * Use the unit testing framework ESPec in the IDE 
 +  * Expert use of the IDE debugger 
 +  * Add clusters and classes with the IDE 
 +  * Use the IDE to generate documentation 
 +===== Your first Eiffel program ​(Hello World) ​=====
  
  
Line 5: Line 26:
  
 In Java you need In Java you need
-  +  *the hello_world.java code   
-(a) the hello_world.java code   +  *the variable CLASSPATH must be set correctly so that the Java runtime will find your classes and the basic pacakges to compile your program.
- +
-(b) the variable CLASSPATH must be set correctly so that the Java runtime will find your classes and the basic pacakges to compile your program.+
  
  
 In Eiffel you also need In Eiffel you also need
-  +  * the ''​hello_world.e'' ​file with the Eiffel code as well as  
-(a) the hello_world.e file with the Eiffel code as well as  +  * an *.ecf file that tells the Eiffel compiler (called ec) where to find your files as well as all the libraries (such as the base library) that your code will be using. ​
- +
-(b) a *.ecf file that tells the Eiffel compiler (called ec) where to find your files as well as all the libraries (such as the base library) that your code will be using. ​+
  
  
Line 37: Line 54:
  
  
-=== Using command line (''​ec16.05''​) ===+=== Using command line (''​ec18.11''​) ===
  
 **//To compile//** your program from the command line, use **//To compile//** your program from the command line, use
  
-  ​ec16.05 hello_world.e+  ​ec18.11 hello_world.e
   ​   ​
-On Prism (Linux), we have renamed the command line compiler (“ec”) to '“ec16.05”, as we are using EiffelStudio version ​16.05.+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 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 ​16.05 Command Prompt (available from the Start menu).+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. 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.
Line 56: Line 73:
  
 You can obtain a finalized executable that can be deployed by any user (without the need for the EiffelStudio environment) by:  You can obtain a finalized executable that can be deployed by any user (without the need for the EiffelStudio environment) by: 
-  ​ec16.05 -c_compile -finalize -config hello_world.ecf+  ​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: ​ 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: ​
Line 65: Line 82:
  
  
-  * Note: If you are using the command line under Windows, then the compiler is ec (not ec16.05). Use the Eiffel ​16.05 command prompt (available from the Start menu). Alternatively,​ensure that: C:\Program Files\Eiffel Software\EiffelStudio ​16.05 GPL\studio\spec\windows\bin is on your PATH variable.+  * Note: If you are using the command line under Windows, then the compiler is ec (not ec18.11). Use the Eiffel ​18.11 command prompt (available from the Start menu). Alternatively,​ensure that: C:\Program Files\Eiffel Software\EiffelStudio ​18.11 GPL\studio\spec\windows\bin is on your PATH variable.
    
  
-===Using IDE (estudio16.05)===+===Using IDE (estudio18.11)===
  
 You can invoke the EiffelStudio IDE on the above project as follows: You can invoke the EiffelStudio IDE on the above project as follows:
  
-   > ​estudio16.05 &+   > ​estudio18.11 &
  
 (On your own install, it is just estudio). (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: ​ 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: ​
-   estudio16.05 foo.ecf &.+   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.) ​ (The ampersand at the end causes the EStudio process to run in the background, leaving the terminal free for further commands.) ​
eiffel/hello/start.1483845994.txt.gz · Last modified: 2017/01/08 03:26 by jonathan