Compiling Prolog-like languages

"Sarah Thompson" <>
2 Jul 2002 01:03:18 -0400

          From comp.compilers

Related articles
Compiling Prolog-like languages (Sarah Thompson) (2002-07-02)
Re: Compiling Prolog-like languages (Bart Demoen) (2002-07-04)
Re: Compiling Prolog-like languages (Torben Ęgidius Mogensen) (2002-07-04)
Re: Compiling Prolog-like languages (Neelakantan Krishnaswami) (2002-07-04)
Re: Compiling Prolog-like languages (Hans Aberg) (2002-07-04)
Re: Compiling Prolog-like languages (Peter Ilberg) (2002-07-04)
Re: Compiling Prolog-like languages (Roberto Waltman) (2002-07-04)
[9 later articles]
| List of all articles for this month |

From: "Sarah Thompson" <>
Newsgroups: comp.lang.prolog,comp.compilers
Date: 2 Jul 2002 01:03:18 -0400
Keywords: prolog
Posted-Date: 02 Jul 2002 01:03:18 EDT

(This is mentioned to some extent in the c.l.prolog FAQ, but the links
in there would appear to be old and dead. I'm cross-posting to
comp.compilers also, because this is a compiler implementation
question so falls within that group's remit too)

I am in the process of designing and implementing a compiler for a
special purpose programming language that is intended to facilitate
the implementation of natural language chat systems (chatterbots).
Lexical analysis and syntax analysis of natural language is already
taken care of, and simple procedural scripting is supported. However,
I feel the need for a 'back-end', for want of a better description,
which supports theorem-prover/unification functionality. Since my
language is compiled, I am looking for algorithms that could support
true compilation rather than just running in an interpreted

Prolog-like syntax would dovetail neatly with the language's existing
syntax (think of something like, lex, yacc and bash glued together,
but with much more capable NL parsing functionality, and you'd be
somewhere in the right direction).

Before I weigh into this and start reinventing considerable quantities
of wheels, I thought it might make sense to ask some questions here.

1. Can someone point toward a good tutorial on implementing
Prolog-like programming languages?

2. Much of the literature mentions the Warren Abstract Machine. Is
this regarded as the best way to go, or are there
simpler/faster/better/newer alternatives worthy of consideration?

3. I currently use C++ as a target language, although this is intended
to be an interim step toward a lower level code generator. Is this
likely to be good/bad/indifferent as regards implementing a WAM or
something similar to it?

I should probably mention that I really do want to write my own
implementation. I have my reasons for this, which are mostly
associated with the need to have this functionality fit within a wider
(established, already working) framework.

Sarah Thompson

Post a followup to this message

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