Getting Started (Windows)
Installation
- Download
eiffel_notebook_setup_1.0.0-alpha.34.exe - Run the installer with administrator privileges
- The CLI is added to PATH automatically
- EiffelStudio is auto-detected
First Session
Open a command prompt and type eiffel_notebook:
Eiffel Notebook 1.0.0-alpha.34
Type Eiffel code to execute. Type -help for commands.
e[1]> name: STRING := "World"
...
e[1] Output:
e[2]> print ("Hello, " + name + "!")
...
e[2] Output:
Hello, World!
Linux and WSL2 Setup
Prerequisites
- Install build tools:
sudo apt update sudo apt install build-essential gcc make - Install EiffelStudio from eiffel.com
Required Environment Variables
Add these to ~/.bashrc for persistence:
# EiffelStudio configuration (REQUIRED)
export ISE_EIFFEL=$HOME/Eiffel_25.02
export ISE_PLATFORM=linux-x86-64
export ISE_LIBRARY=$ISE_EIFFEL
export PATH=$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin:$PATH
# Simple Eiffel ecosystem
export SIMPLE_EIFFEL=$HOME/simple_eiffel
ISE_LIBRARY must be set or compilation will fail with
eif_langinfo.h: No such file or directory.
Running the Notebook
# Set environment (or add to ~/.bashrc)
source ~/.bashrc
# Run notebook
~/simple_eiffel/simple_notebook/EIFGENs/notebook_cli/W_code/simple_notebook
WSL2 Notes
WSL2 works identically to native Linux. The notebook has been tested on Ubuntu 22.04 under WSL2.
Writing Code
Cell Types
Cells are automatically classified:
| Pattern | Type | Example |
|---|---|---|
| identifier: TYPE | Attribute | x: INTEGER |
| name do...end | Routine | greet do print ("Hi") end |
| Contains := | Instruction | x := 42 |
| Everything else | Expression | x * 2 |
| class NAME...end | Class | class CAR feature...end |
Multi-line Input
After typing code, press Enter. You will see ... for continuation.
Press Enter on an empty line to execute the cell.
Design by Contract
e[1]> safe_divide (a, b: INTEGER): INTEGER
... require
... b_not_zero: b /= 0
... do
... Result := a // b
... end
...
Multi-Class Support
Alpha 34 introduces full multi-class support with multiple inheritance.
Creating Classes
Use -class NAME to enter class definition mode:
e[1]> -class CAR
class CAR
feature
drive do print ("Driving on road%N") end
end
...
e[1] Output:
e[2]> -class BOAT
class BOAT
feature
sail do print ("Sailing on water%N") end
end
...
e[2] Output:
Multiple Inheritance
Combine classes using Eiffel's powerful multiple inheritance:
e[3]> -class CAR_BOAT
class CAR_BOAT
inherit
CAR
BOAT
feature
amphibious_mode do
print ("Entering water...%N")
sail
print ("Back on land...%N")
drive
end
end
...
e[3] Output:
Using Your Classes
e[4]> v: CAR_BOAT
e[5]> create v
e[6]> v.amphibious_mode
Entering water...
Sailing on water
Back on land...
Driving on road
Editing Existing Classes
Use -class NAME again to edit a class you already defined:
e[7]> -class CAR
Editing class CAR (cell 1):
class CAR
feature
drive do print ("Driving on road%N") end
end
Type complete new class (starts with 'class CAR'):
class CAR
feature
drive do print ("Vroom! Driving on road%N") end
honk do print ("Beep beep!%N") end
end
...
Class CAR updated in cell 1.
Opening in EiffelStudio
After running cells, open the workspace in EiffelStudio for full IDE features:
- Run some cells to create a working session
- Navigate to the workspace directory (shown at startup)
- Open the
.ecffile in EiffelStudio - Debug, browse, or modify with full IDE features
This is useful for debugging complex code, exploring generated classes, or experimenting before updating cells.
Commands Reference
Session Commands
| Command | Alias | Description |
|---|---|---|
-help | -h | Show help |
-quit | -q | Exit notebook |
-clear | -c | Clear all cells |
Cell Management
| Command | Alias | Description |
|---|---|---|
-cells | List all cells | |
-show N | -s N | Show cell N |
-edit N | -e N | Edit cell N |
-delete N | -d N | Delete cell N |
Execution
| Command | Description |
|---|---|
-run | Re-execute all cells |
-compile verbose | Show streaming compiler output |
-compile silent | Hide compiler output |
Inspection
| Command | Description |
|---|---|
-vars | Show tracked variables |
-class | Show generated Eiffel class |
-class NAME | Create or edit class NAME |
-debug | Show cell classifications |
Troubleshooting
Failed to start compiler
EiffelStudio not found. Set ISE_EIFFEL environment variable or create config.json.
eif_langinfo.h: No such file or directory (Linux)
Set ISE_LIBRARY=$ISE_EIFFEL in your environment.
Unknown identifier
Declare variables before use: x: INTEGER then x := 42
Compilation hangs
Check Task Manager (Windows) or ps aux | grep notebook (Linux) for stuck processes.
Session Logs
Check the log file shown at startup for debugging information.