Re: Compiling Prolog-like languages

"Hans Aberg" <haberg@matematik.su.se>
4 Jul 2002 23:06:08 -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)
Re: Compiling Prolog-like languages oz@blue.cs.yorku.ca (ozan s yigit) (2002-07-15)
[4 later articles]
| List of all articles for this month |

From: "Hans Aberg" <haberg@matematik.su.se>
Newsgroups: comp.lang.prolog,comp.compilers
Date: 4 Jul 2002 23:06:08 -0400
Organization: Mathematics
References: 02-07-004
Keywords: prolog
Posted-Date: 04 Jul 2002 23:06:08 EDT

  "Sarah Thompson" <sarah@telergy.com> wrote:
>1. Can someone point toward a good tutorial on implementing
>Prolog-like programming languages?


I had this problem recently, and it turned out to be real difficult to
find any good info about that. -- Everybody seemed to be autodidact. :-)


So eventually, I took the Mini-Prolog that comes with Hugs
http://haskell.org/hugs, written in Haskell then, and translated it into
C++, replacing its slow parser with a Flex/Bison combination. In the
translation, I had to work around Haskell's laziness, and I successively
flattened out the recursive function calls until arriving at a single loop
with jumps, an essentially simplified interpreted version of the WAM. This
Mini-Prolog has examples of three different CLP engines. Some bug in the
Prolog cut, I recall.


I found the code good for experimenting, like adding Buchberger's Groebner
basis algorithm for experimenting with enhanced unification systems,
experimenting with CLP syntax, relating to proof finding systems and set
theory a bit. -- The things I happened to be interested in at the time.


Then a book on the WAM machine is available freely on the Internet.
    http://www.isg.sfu.ca/~hak/documents/wam.html
It is essentially way to produce efficient compiled code, I recall.


    Hans Aberg * Anti-spam: remove "remove." from email address.
                                    * Email: Hans Aberg <remove.haberg@member.ams.org>
                                    * Home Page: <http://www.matematik.su.se/~haberg/>
                                    * AMS member listing: <http://www.ams.org/cml/>


Post a followup to this message

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