Prev Next Up Home Keys Figs Search New

Prolog Interpreter in C++ / Java

Appeared in Volume 9/4, November 1996

Keywords: C++, java.


rmitchle@cs.uct.ac.za
Ryan G Mitchley
10th June, 1996

I asked my lecturer if I could implement a Prolog interpreter in C++ as my CS project. His response was that he does not find Prolog "either interesting or useful". Any comments?


HSchotel@vms.uci.kun.nl
Henk Schotel
11th June 1996

Some practical Prolog applications are described at:
http://www.demon.co.uk/ar/NCSA-Mosaic/PAP96/index.html

I suggest that you use Java to implement your Prolog interpreter, not C++. This would make it platform independent, and might lead to some interesting ways of combining Prolog and the Web.

"Old" Prolog implementations are mentioned in:
http://www.cs.cmu.edu/Web/Groups/AI/html/faqs/lang/prolog/prg/top.html

For inspiration (and maybe code!) take a look at the site that is implementing Scheme in Java:
http://www.winternet.com/~sgml/kawa/


ok@goanna.cs.rmit.edu.au
Richard A. O'Keefe
12th June 1996

If I was going to implement a logic programming language in Java, I wouldn't make it Prolog. I'd move all the imperative bits to Java. I'd make the logic part just as clean and logical as I could.

Amongst other things, compiling Prolog to the JVM would not be a very good idea; ask in comp.lang.lisp what some of the problems are. (To start with, the JVM doesn't tag numbers.)

It might be worth while to consider a (polymorpic) type checked language. That might be a rather better fit to the JVM.

I've never used Smalltalk/V. Wasn't it supposed to have some sort of "Prolog" component? It might be a source of ideas.

Henk Schotel mentions http://www.winternet.com/~sgml/kawa/. Release 0.2 of Kawa was announced recently in comp.lang.scheme. It's an interpreter. Running interpreted Scheme (or an interpreted Prolog) in an interpreted interpreter does not sound like a good way to convince people that Scheme (or Prolog) can be efficient.


kohlerm@betze.bbn.hp.com
Kohler Markus
18th June 1996

An interpreter written in Java is a good starting point for compiling Prolog (or Scheme, etc.) to Java source code.

Simply use Java as a very portable assembler!


eddie@voldsboks.pvv.ntnu.no
Kjetil Valstadsve
26th August 1996

Per Bothner's Kawa scheme interpreter in Java does some compiling. As for a real compiler, we're working on it this semester, and hopefully we'll be able to come up with something. If anyone is interested, please get in touch.

Prev Next Up Home Keys Figs Search New