At SATTOSE2013, Sergio Castro presented his work in progress on developing a software ecosystem for Java-Prolog interoperabilty.
The Prolog community, although continuously accomplishing relevant research results on different aspects of Software Engineering, is fragmented by the lack of a common rich ecosystem comparable to the ones surrounding languages belonging to, for example, the object-oriented programming paradigm. This hinders the agile development of new software and often forces practitioners to reimplement existing artifacts, to accommodate them to the requirements of their specific incompatible environments. Some libraries exist that alleviate this problem by providing bridges to object-oriented languages, such as Java, which are surrounded by rich ecosystems. As such, the logic programming community can access and reuse well proven existing frameworks and libraries from these ecosystems. Unfortunately, these bridge libraries themselves suffer from the symptoms of a fragmented community: they provide user and programming interfaces that cannot easily be reused with other libraries that are targeting essentially the same problem. To solve this problem, we have developed a library that decouples the high level programming interface supporting common Java–Prolog operations, from a provider–dependent library interacting with a Prolog engine. A similar approach has been successfully used in the past in the domain of Java-databases interaction (e.g., JDBC). Our library, in addition to proposing a common high level API, provides a simple and modular mechanism for expressing mappings between Prolog and Java artifacts. In addition, we implement a set of reusable components that can be reused independently of the underlying Prolog engine and bridge library.
We illustrate our approach by means of an application allowing a user to visually query geographical data by means of Prolog queries, that can easily change its Prolog engine and bridge library at runtime. We demonstrate how the client code in our example is completely decoupled from any bridge library serving as a port between the two worlds.