From: Noah Lavine <noah.b.lavine@gmail.com>
To: Noah Lavine <noah.b.lavine@gmail.com>
Cc: Andy Wingo <wingo@pobox.com>, guile-devel <guile-devel@gnu.org>
Subject: Re: CPS thoughts
Date: Thu, 23 May 2013 00:05:02 -0400 [thread overview]
Message-ID: <CA+U71=Nj9JPhGZrfnAjABnB6Xht03MoDotiODH4+WdQw96WJWA@mail.gmail.com> (raw)
In-Reply-To: <CA+U71=PqS3obSXwm-3aZ8zqDw8=69xUJaCPtV3D18ux8Ltzgtw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3334 bytes --]
An update: I just rebased wip-rtl-cps on top of wip-rtl-may-2013 and
pushed. The most interesting thing was how trivial it was: all I had to do
was make a one-line change in how I called `begin-program'.
Best,
Noah
On Wed, May 22, 2013 at 12:33 AM, Noah Lavine <noah.b.lavine@gmail.com>wrote:
> Hello,
>
> On Tue, May 21, 2013 at 3:46 PM, Andy Wingo <wingo@pobox.com> wrote:
>
>> You should have two names: the original ones and the gensyms that come
>> from tree-il. Creating new gensyms should happen when copying or
>> fabricating new nodes, as peval does, but in most cases you don't need
>> to do it, and in any case it can be tricky.
>>
>> I would take tree-il as the guide here.
>>
>
> I'll look at it, thanks.
>
>
>> I haven't handled source information yet, but to the CPS->RTL compiler
>> it will look like emitting special instructions, like the tree-il->glil
>> compiler emits <glil-source> nodes.
>>
>
> That sounds fairly simple to implement.
>
>
>> This is lambda-properties. You just pass them through, and add them to
>> the begin-program in the RTL.
>>
>
> Again, this seems relatively simple to do.
>
>
>> Note that wip-rtl-may-2013 and the RTL branches that are under review
>> for master are slightly different from the ones you have. Their
>> begin-program has a second argument, the procedure properties, and the
>> first argument is a label and not a name. They have begin-*-arity and
>> end-arity for marking arity information and performing arity prologues.
>> There are some slight changes to instructions but not much. OTOH they
>> do have some better type checking and a disassembler that works, so many
>> things should be easier ;) Compare the rtl.test there and your rtl.test
>> for details.
>>
>> > * Why is there no "let" that can bind functions? You don't always
>> > want
>> > to set up a recursive binding environment.
>>
>
> I think right now the Tree-IL->CPS compiler will turn (let ((f (lambda
> ...))) ...) into something like this:
>
> ((lambda (f-12345)
> .... let body here ....)
> (letrec ((f-func (lambda ... f's body here ...))) f-func))
>
> (I'm not showing the continuation's name because it would make it even
> more complicated than it already is.)
>
> I agree that this is a crazy way to do it. It should detect this case and
> skip the extra steps.
>
>
>> Understood. However the question of language is fundamental for
>> enabling collaboration on this code. I would be very happy to see a CPS
>> language definition that could express all of Tree-IL. I don't think
>> this would take a lot of work -- it is perfectly acceptable to throw
>> "unimplemented" for those parts of the compiler that aren't there yet,
>> but the language itself should be adequately expressive. IMHO anyway.
>>
>> Do you think you will have time to do that over the next few days or so?
>> Apologies for the pressure, just that I would like to do some things in
>> this area and am not sure how best to do them :)
>>
>
> This is interesting - I had been adding to the language as I needed
> features, and not really thinking of it as an interface. But you might be
> right. I just started rebasing tonight, and I hope to work more on it in
> the next two days. But I don't want to be a blocker for your work - what
> are you trying to do?
>
> Thanks a lot,
> Noah
>
>
[-- Attachment #2: Type: text/html, Size: 4945 bytes --]
next prev parent reply other threads:[~2013-05-23 4:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-20 20:19 CPS thoughts Andy Wingo
2013-05-21 3:21 ` Noah Lavine
2013-05-21 19:46 ` Andy Wingo
2013-05-22 4:33 ` Noah Lavine
2013-05-23 4:05 ` Noah Lavine [this message]
2013-05-23 7:20 ` Andy Wingo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+U71=Nj9JPhGZrfnAjABnB6Xht03MoDotiODH4+WdQw96WJWA@mail.gmail.com' \
--to=noah.b.lavine@gmail.com \
--cc=guile-devel@gnu.org \
--cc=wingo@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).