Re: Prolog -> Java, C++, ..

bmd@cs.kuleuven.ac.be (Bart Demoen)
4 Aug 2000 15:50:30 -0400

          From comp.compilers

Related articles
Prolog -> Java, C++, .. gwiggner@informatik.uni-muenchen.de (Claus Gwiggner) (2000-07-27)
Re: Prolog -> Java, C++, .. gabor@mac.com (Gabor Greif) (2000-07-29)
Re: Prolog -> Java, C++, .. bmd@cs.kuleuven.ac.be (2000-08-04)
| List of all articles for this month |

From: bmd@cs.kuleuven.ac.be (Bart Demoen)
Newsgroups: comp.compilers
Date: 4 Aug 2000 15:50:30 -0400
Organization: BELNET
References: 00-07-070
Keywords: Java, C++

  Claus Gwiggner <gwiggner@informatik.uni-muenchen.de> writes:
|> Are there compilers that generate Java or C++ Code from Prolog sources ?
|>
|> How is the speedup ?


Several systems compiling Prolog to Java exist; just a few of them:


http://www.cs.kuleuven.ac.be/~bmd/PrologInJava/
http://www.bird-land.com/java/prolog/index.html
http://www.cs.mu.oz.au/~winikoff/wp/
http://Prolog.isac.co.jp/jipl/index_e.html


|> How is the speedup ?


No speedup: Prolog implementations tend to be in good shape these days and
it is difficult - if not impossible - to gain by going to Java.
Moreover, most often the above systems were not aiming at speed.




|> My situation is: I wrote a prototype of one part of a project in
|> Prolog. The other part is written in Java. I need to merge them
|> into an efficient whole (it is a data mining project).


Have a look at http://www.binnetcorp.com/ and BinProlog in particular;
maybe you will decide not to merge after all. Many Prolog systems have
a Java interface and you are probably better off staying in Prolog for
part of your application.




There are also several systems that compile to C - GNU Prolog, wamcc, ...
They don't beat a good emulator, but could be good for your intended merge.




Mercuy is not Prolog btw: it needs declarations and lacks the full power of the
logical variable. Some Prolog programs are difficult to transform to Mercury.
But for lots of Prolog programs it is just straithforward boring work. IO can
be a problem - depending on your Prolog coding style - because Mercury doesn't
allow IO in non-deterministic code. But with the C-interface you can work
around that too.


Good luck


Bart Demoen


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.