Previous Up Next

Chapter 3  Managing Data and Memory in Mixed-Language Applications

ECLiPSe is a software engine for constraint propagation and search tasks. As such, it represents its data in a form that is different from how it would be represented in a traditional C/C++ program. In particular, the ECLiPSe data representation supports automatic memory management and garbage collection, modifications that can be undone in a search context, referential transparency and dynamic typing.

In a mixed-language application, there are two basic ways of communicating information between the components coded in the different languages:

Conversion:
When data is needed for processing in another language, it can be converted to the corresponding representation. This technique is appropriate for simple data types (integers, strings), but can have a lot of overhead for complex structures.
Sharing:
The bulk of the data is left in its original representation, referred to by a handle, and interface functions (or methods) provide access to its components when required.

Both techniques are supported by the ECLiPSe/C and ECLiPSe/C++ interface.


Previous Up Next