From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Re: order of evaluation Date: Mon, 17 Jun 2013 17:39:19 -0700 Message-ID: References: <87li6959oz.fsf@pobox.com> <87mwqo4hr5.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b15b0fdbc2e0c04df62f2cf X-Trace: ger.gmane.org 1371515987 25049 80.91.229.3 (18 Jun 2013 00:39:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Jun 2013 00:39:47 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jun 18 02:39:48 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Uojxc-0000JH-18 for guile-devel@m.gmane.org; Tue, 18 Jun 2013 02:39:48 +0200 Original-Received: from localhost ([::1]:50451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uojxb-0002kT-H7 for guile-devel@m.gmane.org; Mon, 17 Jun 2013 20:39:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UojxY-0002io-2m for guile-devel@gnu.org; Mon, 17 Jun 2013 20:39:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UojxU-0001vE-DI for guile-devel@gnu.org; Mon, 17 Jun 2013 20:39:44 -0400 Original-Received: from mail-pb0-x230.google.com ([2607:f8b0:400e:c01::230]:33222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UojxU-0001v2-2H for guile-devel@gnu.org; Mon, 17 Jun 2013 20:39:40 -0400 Original-Received: by mail-pb0-f48.google.com with SMTP id ma3so3311633pbc.35 for ; Mon, 17 Jun 2013 17:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=9QmmLHn/kh1UNbjsfcMohu/Ch5FrOZlmu1T+gyeMrfA=; b=gvojP63Rg5Oad21PVJ3cYRJTBzF2p9JY/Uz/yPOLrbjibU7DKS/ape+7FksyO880kc 1pRb++nBuji2L1/yibitCnBWuMWqtv/av8P2jkSWAdxdzaUhepCwahFYzdWhPXAZuF+8 zFkfJkW720CUDNRKvlrnJgT9C1FqUfhFpJXhRRtEnbnFix33JGnBG4yEiPmqt5iCG63l eIgBqmEhwlFwfjbd9r2ONYskdovwIh8rg1mdMkZSqfCwHoioOyJa7EjVp4A83l09KAIL QDcVLKfILU+Ob4rxtQ7+YGR1hMEZ7h4T9Mb9XAXShKS0+TuFfBWncjOISJMhEb9mAwi1 2fRA== X-Received: by 10.67.4.196 with SMTP id cg4mr15140862pad.117.1371515979047; Mon, 17 Jun 2013 17:39:39 -0700 (PDT) Original-Received: by 10.68.129.4 with HTTP; Mon, 17 Jun 2013 17:39:19 -0700 (PDT) In-Reply-To: <87mwqo4hr5.fsf@pobox.com> X-Google-Sender-Auth: SeXAGIt48_17h7ioMuvX1rZZcIY X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::230 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16496 Archived-At: --047d7b15b0fdbc2e0c04df62f2cf Content-Type: text/plain; charset=ISO-8859-1 Hello, On Mon, Jun 17, 2013 at 1:14 PM, Andy Wingo wrote: > > So it's exactly like `let', then? ;) > Oh, yes, you're right. :-) > > > I think we could make CSE work with this, don't you think? > > Oh sure. It works with let already. It's just not as effective. > > To translate this into CPS, I think you need a form that introduces a > > continuation for every unspecified-order clause and then merges them, > > like this: > > > > (let ((foo-cont (lambda (A C) (foo A C)))) > > (let-merge-points ((A A-cont) (C C-cont)) > > (let ((make-A ((lambda () (a (b))))) ;; not CPS-translating this > > (make-C ((lambda () (c (d)))))) > > (any-order (make-A A-cont) (make-C C-cont))))) > > > > Here let-merge-points introduces several continuations, and any-order > > calls them in any order. What do you think? > > It's tough for me to read this example. Does it have some strange > formatting? > Yes, I'm using a webmail client. The formatting probably got messed up there. In retrospect, that's too complicated anyway. I think we can make something very much like a `let' work in CPS, but I realize that's not ideal. > If I understand correctly, I think this is going in the wrong > abstractive direction -- CPS is nice because it's a limpid medium for > program transformations that also corresponds neatly to runtime. With > this sort of thing we'd be moving farther away from the kind of code we > want to emit. Dunno. > I think there's sort of a fundamental problem here - the point of leaving the order undefined is that we don't know what code we want to emit yet, so we might have to move further away from emitted code. But I also don't think that's a bad thing as long as it's for something that's really useful, like reordering function arguments. What do you think? Noah --047d7b15b0fdbc2e0c04df62f2cf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,

On Mon, Jun 17, 2013 at 1:14 PM, Andy Wingo <= ;wingo@pobox.com&g= t; wrote:
So it's exactly like `let', then? ;)

Oh, yes, you're right. :-)
=A0

> I think we could make CSE work with this, don't you think?

Oh sure. =A0It works with let already. =A0It's just not as effect= ive.=A0

> To translate this into CPS, I think you need a form that introduces a<= br> > continuation for every unspecified-order clause and then merges them,<= br> > like this:
>
> (let ((foo-cont (lambda (A C) (foo A C))))
> (let-merge-points ((A A-cont) (C C-cont))
> (let ((make-A ((lambda () (a (b))))) ;; not CPS-translating this
> (make-C ((lambda () (c (d))))))
> (any-order (make-A A-cont) (make-C C-cont)))))
>
> Here let-merge-points introduces several continuations, and any-order<= br> > calls them in any order. What do you think?

It's tough for me to read this example. =A0Does it have some stra= nge
formatting?

Yes, I'm using a webmai= l client. The formatting probably got messed up there.

=
In retrospect, that's too complicated anyway. I think w= e can make something very much like a `let' work in CPS, but I realize = that's not ideal.
=A0
If I understand correctly, I think this is going in the wrong
abstractive direction -- CPS is nice because it's a limpid medium for program transformations that also corresponds neatly to runtime. =A0With this sort of thing we'd be moving farther away from the kind of code we=
want to emit. =A0Dunno.

I think there&#= 39;s sort of a fundamental problem here - the point of leaving the order un= defined is that we don't know what code we want to emit yet, so we migh= t have to move further away from emitted code. But I also don't think t= hat's a bad thing as long as it's for something that's really u= seful, like reordering function arguments.

What do you think?

Noah

--047d7b15b0fdbc2e0c04df62f2cf--