Re: Pros and cons of high-level intermediate languages

ridoux@irisa.fr (Olivier Ridoux)
Tue, 4 Aug 1992 10:55:15 GMT

          From comp.compilers

Related articles
[17 earlier articles]
Re: Pros and cons of high-level intermediate languages sewardj@cs.man.ac.uk (1992-07-26)
Re: Pros and cons of high-level intermediate languages ridoux@irisa.fr (1992-07-27)
Re: Pros and cons of high-level intermediate languages gat@forsight.jpl.nasa.gov (1992-07-29)
Re: Pros and cons of high-level intermediate languages moss@cs.umass.edu (1992-07-30)
Re: Pros and cons of high-level intermediate languages boehm@parc.xerox.com (1992-07-30)
Re: Pros and cons of high-level intermediate languages graham@maths.su.oz.au (1992-08-02)
Re: Pros and cons of high-level intermediate languages ridoux@irisa.fr (1992-08-04)
Re: Pros and cons of high-level intermediate languages kanze@us-es.sel.de (1992-08-04)
Re: Pros and cons of high-level intermediate languages boehm@parc.xerox.com (1992-08-03)
Re: Pros and cons of high-level intermediate languages rjbodkin@theory.lcs.mit.edu (Ronald Bodkin) (1992-08-04)
Re: Pros and cons of high-level intermediate languages optima!kwalker@cs.arizona.edu (1992-08-04)
Re: Pros and cons of high-level intermediate languages chased@rbbb.Eng.Sun.COM (1992-08-04)
Re: Pros and cons of high-level intermediate languages nfsun!gchamber@uunet.UU.NET (1992-08-04)
[4 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: ridoux@irisa.fr (Olivier Ridoux)
Organization: IRISA, Rennes (Fr)
Date: Tue, 4 Aug 1992 10:55:15 GMT
Keywords: C, prolog
References: 92-07-095

>[one can write more-or-less continuation passing C code with this loop:]
> while (TRUE) { cont = (*cont)(); }


Everybody knows about this technique. We are actually using in Prolog.
We are calling the above loop the "motor". But to split a program in as
many C functions as there are storable control points is not reallistic.


E.g. in Prolog, it is fair to map every predicate onto a C function, but
to go further is a non-sense as far as efficiency is concerned. One wants
to be able to goto from a clause to another one inside a predicate, yet
one also want to store and read a clause label for handling bactracking.


Furthermore, some useful improvements come easily if C functions
correspond to a high-level semantical unit. E.g. in Prolog, (I suppose
something similar can be done for a functional language) left-recursive
clauses need not return to the motor, they merely have to loop.
Left-recursion translates to iteration.


Splitting into too small bits also hinders any chance for locality.


Olivier Ridoux
--


Post a followup to this message

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