Re: Compiling Prolog-like languages

"Neelakantan Krishnaswami" <neelk@alum.mit.edu>
4 Jul 2002 23:05:17 -0400

          From comp.compilers

Related articles
Compiling Prolog-like languages sarah@telergy.com (Sarah Thompson) (2002-07-02)
Re: Compiling Prolog-like languages bmd@cs.kuleuven.ac.be (Bart Demoen) (2002-07-04)
Re: Compiling Prolog-like languages torbenm@pc-032.diku.dk (Torben Ægidius Mogensen) (2002-07-04)
Re: Compiling Prolog-like languages neelk@alum.mit.edu (Neelakantan Krishnaswami) (2002-07-04)
Re: Compiling Prolog-like languages haberg@matematik.su.se (Hans Aberg) (2002-07-04)
Re: Compiling Prolog-like languages peter.ilberg@ni.com (Peter Ilberg) (2002-07-04)
Re: Compiling Prolog-like languages rwaltman@verizon.net (Roberto Waltman) (2002-07-04)
Re: Compiling Prolog-like languages thomasl@erix.ericsson.se (Thomas Lindgren) (2002-07-15)
Re: Compiling Prolog-like languages adamo@dblab.ece.ntua.gr (Yiorgos Adamopoulos) (2002-07-15)
Re: Compiling Prolog-like languages ptarau@yahoo.com (Paul Tarau) (2002-07-15)
[5 later articles]
| List of all articles for this month |
From: "Neelakantan Krishnaswami" <neelk@alum.mit.edu>
Newsgroups: comp.lang.prolog,comp.compilers
Date: 4 Jul 2002 23:05:17 -0400
Organization: AT&T Broadband
References: 02-07-004
Keywords: prolog
Posted-Date: 04 Jul 2002 23:05:17 EDT

Sarah Thompson <sarah@telergy.com> wrote:
>
> 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?


Hassan Ait-Kaci's _Warren's Abstract Machine: A Tutorial
Reconstruction_ is probably the best there is.


> 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?


Another possibility is to use a continuation-passing style framework.
This mails tail merging easier to do, and there are a *lot* of papers
on how to efficiently compile CPS code.


> 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?


It will likely be quite difficult to add backtracking to an
implementation that compiles to C++ -- you really want stack
manipulation primitives. If I had to use C++ I would probably
go for a bytecode interpreter.


--
Neel Krishnaswami
neelk@alum.mit.edu


Post a followup to this message

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