Eiffel Notebook User Guide

Version 1.0.0-alpha.34

Getting Started (Windows)

Installation

  1. Download eiffel_notebook_setup_1.0.0-alpha.34.exe
  2. Run the installer with administrator privileges
  3. The CLI is added to PATH automatically
  4. 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

  1. Install build tools:
    sudo apt update
    sudo apt install build-essential gcc make
  2. 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
Important: 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:

PatternTypeExample
identifier: TYPEAttributex: INTEGER
name do...endRoutinegreet do print ("Hi") end
Contains :=Instructionx := 42
Everything elseExpressionx * 2
class NAME...endClassclass 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:

  1. Run some cells to create a working session
  2. Navigate to the workspace directory (shown at startup)
  3. Open the .ecf file in EiffelStudio
  4. 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

CommandAliasDescription
-help-hShow help
-quit-qExit notebook
-clear-cClear all cells

Cell Management

CommandAliasDescription
-cellsList all cells
-show N-s NShow cell N
-edit N-e NEdit cell N
-delete N-d NDelete cell N

Execution

CommandDescription
-runRe-execute all cells
-compile verboseShow streaming compiler output
-compile silentHide compiler output

Inspection

CommandDescription
-varsShow tracked variables
-classShow generated Eiffel class
-class NAMECreate or edit class NAME
-debugShow 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.