External Language Interface with Java

As the popularity of Java grows, an interface that bridges Prolog and Java becomes more and more important. On the one hand, Prolog applications can have access to resources in Java, such as the Abstract Window Toolkit(AWT) and networking. On the other hand, Java programs can have access to the functionality such as constraint solving available in Prolog. B-Prolog has a bi-directional interface with Java, which is based on JIPL developed by Nobukuni Kino.

An application that uses the Java interface usually works as follows: The Java part invokes a Prolog predicate and passes it a Java object together with other arguments; the Prolog predicate performs necessary computation and invokes the methods or directly manipulates the fields of the Java object. The examples in the directory at $BPDIR/Examples/java_interface shows how to use Java's resources through the JIPL interface, including AWT and JDBC (MySQL). One should have no difficulty to use other Java resources through the interface such as URL, Sockets, and Servelets.



Subsections
Neng-Fa Zhou 2012-01-03