From z Mon Dec 04 18:36:08 2000
Received: from maguro.epr.com ([198.3.162.27]) by exchange.epr.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21)
	id WNKA3CAL; Mon, 4 Dec 2000 09:34:05 -0800
Received: from magrathea.epr.com (firewall-user@magrathea.epr.com [198.3.160.1])
	by maguro.epr.com (8.9.3/8.9.3) with ESMTP id JAA11648
	for <sweeks@intertrust.com>; Mon, 4 Dec 2000 09:38:00 -0800 (PST)
Received: (from uucp@localhost) by magrathea.epr.com (8.9.3/8.7.3) id JAA21949 for <sweeks@intertrust.com>; Mon, 4 Dec 2000 09:37:59 -0800 (PST)
Received: from nodnsquery(199.222.69.4) by magrathea.epr.com via smap (V5.5)
	id xma021535; Mon, 4 Dec 00 09:37:06 -0800
Received: from clairv.com (IDENT:root@pc246.edi.nunet.net [199.249.165.246])
	by mail.acm.org (8.9.3/8.9.3) with ESMTP id MAA24844
	for <sweeks@acm.org>; Mon, 4 Dec 2000 12:37:01 -0500
Received: from magrathea.epr.com (firewall-user@magrathea.epr.com [198.3.163.3])
	by clairv.com (8.9.3/8.9.3) with ESMTP id LAA31738
	for <MLton@sourcelight.com>; Mon, 4 Dec 2000 11:37:01 -0600
Received: (from uucp@localhost) by magrathea.epr.com (8.9.3/8.7.3) id JAA21500 for <MLton@sourcelight.com>; Mon, 4 Dec 2000 09:36:59 -0800 (PST)
Received: from unknown(198.3.162.27) by magrathea.epr.com via smap (V5.5)
	id xma021136; Mon, 4 Dec 00 09:36:08 -0800
Received: from eponym.epr.com (eponym.epr.com [10.1.1.123])
	by maguro.epr.com (8.9.3/8.9.3) with ESMTP id JAA11480;
	Mon, 4 Dec 2000 09:36:08 -0800 (PST)
Received: (from sweeks@localhost)
	by eponym.epr.com (8.9.3/8.9.3) id JAA20999;
	Mon, 4 Dec 2000 09:36:08 -0800
From: "Stephen Weeks" <sweeks@intertrust.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <14891.54792.694163.309467@eponym.epr.com>
Date: Mon, 4 Dec 2000 09:36:08 -0800 (PST)
To: MLton@sourcelight.com
Cc: jhr@research.bell-labs.com
Reply-to: MLton@sourcelight.com
Subject: Re: CWS paper
In-Reply-To: <200012041728.LAA08907@nimrod.clairv.com>
References: <200012041728.LAA08907@nimrod.clairv.com>
X-Mailer: VM 6.71 under 20.4 "Emerald" XEmacs  Lucid
X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on 
	eponym.sweeks.com
X-Spam-Level: 
X-Spam-Status: No, hits=0.0 required=3.0 tests=AWL autolearn=no version=2.60


> Stephen  knows  this  stuff better than I, but I know that we talked a lot to
> Richard about his experiences with full CPS conversion and I  know  that  the
> notion  of  using  CPS to express the intra-procedural flow was from him.  At
> the time I was arguing for the advantages of CPS (over direct  style)  and  I
> remember  showing  an example from Shiver's thesis where top-level procedures
> were transformed into continuations (because they always were called with the
> same  continuation).   I  think  that Stephen put contification into MLton in
> response to that.  (Although it might have waited until he saw that this  was
> going to be required for nested loops, as in matrix multiplication.)

That all sounds right.  I remember the most annoying problem that we had with
the direct style IL was that we were allocating tuples for code like the
following:

val (x, y) = if ... then (a, b) else (c, d)

This was absolutely killing us in some benchmarks.  We could have gone to some
variant of a direct style IL that allowed a "flat" tuple to be returned in the
branches of the if, but it was so much easier to go to CPS with multi-argument
continuations and do:

fun L (x, y) = ...
if ... then L (a, b) else L (c, d)


