External Language Interface with Java

As the popularity of Java grows, it becomes more important to have an interface that bridges between Prolog and Java. In one direction, Prolog applications can have access to Java's resources, such as the Abstract Window Toolkit(AWT) and networking. In the other direction, Java programs can have access to Prolog's functionality, such as constraint solving. B-Prolog has a bi-directional interface with Java, which is based on the JIPL package that was 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 computations, and invokes the Java object's methods, or directly manipulates the Java object's fields. The examples in the directory at $BPDIR/Examples/java_interface show how to use Java's resources, including AWT and JDBC (MySQL), through the JIPL interface. There should be no difficulty when using other Java resources, such as URLs, Sockets, and Servlets, through the interface.



Subsections
Neng-Fa Zhou 2013-01-25