[comp.lang.functional] summary intermediate codes for FL

winfabi@dutrun.UUCP (Hans Toetenel) (02/04/91)

A while ago I asked about Intermediate Codes for functional languages.
I received three responses by e-mail, which I herewith summarize.
Also, an interesting discussion developed on the net.
Thank you very much with your help.
Kees Pronk.
kees@dutiaa.tudelft.nl

========================================

From: Nigel Perry <np@doc.ic.ac.uk>
Subject: Re: Intermediate codes for FL

	I'm not sure whether you're after intermediate languages or
something lower-level, however the answer in both cases is yes. The
G-machine is used by the LML compiler and uses a lower-level code
called M-code, information from Thomas or Lenny @ Chalmers (sorry,
mislaid their emial addresses) or look in SPJ's book "The
Implementation of F.P.L". I have a system called Fpm2 which was used
in the Hope+C compiler, this consits of a compiler target language, a
low-level abstract machine code + a concrete implmentation of the
latter for 68K's. It runs very fast (beats LML, SML). I can send you
details of this if you'd like.  If you have Macs I can email you Mac
PostScript, otherwise it'll be smail.  Hope this helps, email
questions if you have any and I'll try to answer.

Nigel


======================

From: Dave Parrott <D.Parrott@cs.ucl.ac.uk>

FLIC is probably the most universal of the intermediate codes because
it was designed to be.  The following paper is the definitive
document:

%A S.L. Peyton-Jones
%A M.S. Joy
%T FLIC - A Functional Language Intermediate Code
%R UCL Internal Note 2048
%O Also Warwick University Research Report 148 (as part of the
   Functional Language Implementation Project, FLIP) and Glasgow
   University Departmental Report
%D August 1989


You also might like to consider:

%A Zena Ariola
%A Arvind
%T P-TAC: A Parallel Intermediate Language 
%I ACM
%J Functional Programming Languages and Computer Architecture
   Conference Proceedings
%P 230--242
%D September 1989

which deals with an intermediate code for parallel, three address
representations of functional programs, and:

%A J.R.W. Gluert
%A J.R. Kennaway
%A M.R. Sleep
%T DACTL: A computational model and compiler target
   	  language based on graph reduction
%J ICL Technical Journal
%V 5
%N 3
%D 1987

DACTL has similar aims to FLIC but is not restricted to functional
programming.

We are using FLIC at UCL for various stages of the compiler design
process, it is available as an optional output from the Chalmers Lazy
ML compiler and the Glasgow Haskell compiler (because the latter is
built on top of the former!).

Dave.

================================

Reply-To: ge@cs.kun.nl

Yes, I know of several intermediate codes for fuctional languages. For
some of these you can refer to Field & Harrison, Functional Programming,
Addison Wesley 1988. I bought mine at Foyles for < 12 pounds.

FPM: Used for implementing the language Hope (see Field & Harrison)
ABC: Used for our own (parallel) graph rewriting language Clean. We translate
	Miranda -> Clean, Clean -> ABC, ABC -> machine code.
	We also use an interpreter for ABC code. Literature on request.
CAM: Categorical abstract machine: See Cousineau et. al., Science of
	computer programming 8 (1987) pp 173-202. A machine of amazing
	simplicity.

Some LISP/Scheme compilers use source-to-source transformations to translate
programs into almost pure lambda calculus in continuation passing style,
which makes code generation easier.

More specific answers need a more specific question (I'm away till
monday, though)

============== - =================