ePolyglot

Victor Putz


Table of Contents
I. ePolyglot -- overview and background
1. Introduction
2. The problem and the solution
3. Tools
4. Conclusion and proposal
5. Requirements
II. Evolution of a Solution
6. Wrapping the Python/C API
Motivation
Theory and first steps
Helper functions in C--making Python helper macros accessable to SWIG
Additional added value--the PYTHON_CLIENT class
7. Shadow Classes
Motivation
Theory
The PYTHON_OBJECT shadow classes
Example: Using Python primitives from within Eiffel
Unit tests
8. Simple use of the embedded Python interpreter
Motivation
Theory
Example
9. User Classes
Motivation
Theory: User-defined classes
The make_eiffel_stub.py script
Example: Using the Python smtplib.SMTP class to send mail from within Eiffel
10. User Modules
Motivation
Theory
The make_eiffel_module Python script
The make_all_eiffel_stubs.py script
User modules at work: the re_test example
11. Calling Eiffel from Python
Motivation
Theory: Eiffel from C using the C-Eiffel Call-In Library
C from Python: Using SWIG to expose our Eiffel bindings to Python
Automating part of the process with make targets and the make_eiffel_glue_i.py script
Compiling the Eiffel exports into the Python-usable module eiffel_gluemodule.so
Simpler and Safer: Shadow classes for calling Eiffel from Python
Automating shadow class generation: the make_python_shadow_classes.py script
Problem 1: Garbage, garbage, who's got the garbage?
Problem 2: A tale of two binaries
The eiffel_from_python sample application
12. Scripting Eiffel with Python
Motivation
Theory
Why a custom interpreter?
The scripting_eiffel sample program
13. Haskell from Eiffel
Motivation
Theory--HaskellDirect
Our sample problem: Linear Regression
IDL: Writing the module interface
You mean HaskellDirect doesn't work?
C to Eiffel--Using SWIG to export the regression functions
Compiling the example
Sample program regression_test
14. All three: Eiffel, Python, and Haskell together
Motivation
Theory
Build problems with the multilanguage regression_test
Sample program regression_test, in three languages
15. Lessons Learned
III. Reference Documentation
16. The ePolyglot Eiffel object hierarchy
PYTHON_CLIENT and the low level interface
PYTHON_OBJECT
The PYTHON_NUMBER tree
The PYTHON_SEQUNCE tree
The PYTHON_MAPPING tree
PYTHON_FILE
PYTHON_OBJECT_FACTORY
PYTHON_USER_CLASS
PYTHON_MODULE
PYTHON_USER_MODULE
17. The supporting Python scripts for code generation
18. Dependencies and Data Flow
Making usable Eiffel classes from Haskell source code
Eiffel stubs from Python classes
Making Python shadow classes from Eiffel classes
Bibliography
Examination and development of multilanguage programming using Eiffel, Python, and Haskell