caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Trevor Jim <trevor@research.att.com>
To: Chet Murthy <chet@watson.ibm.com>
Cc: caml-list@inria.fr
Subject: Re: de Bruijn indices
Date: 12 Oct 2000 14:19:06 -0400	[thread overview]
Message-ID: <dr93di1c485.fsf@raptor.research.att.com> (raw)
In-Reply-To: Chet Murthy's message of "Thu, 12 Oct 2000 10:57:56 -0400"

Chet Murthy <chet@watson.ibm.com> writes:

> It wasn't the substitution that was killing me, but the
> alpha-conversion, and checks for alpa-conversion.
> 
> Now, there _is_ possibly one way of doing explicit names that would be
> fast enough to be a contender -- where the names are chosen uniquely,
> using a global counter, so no capture check is required.  I can
> imagine that that would be fast.

We used exactly this strategy in the optimizer of SML/NJ (see Journal
of Functional Programming 7(5), September 1997 for some more detail).
Variable names are essentially a string plus a counter, e.g.,
foo15432.  Only compiler writers see these names, so the ugliness of
the output was not a big concern.

A "hidden" expense is that you have to preserve the following critical
invariant through optimization: every variable is bound at most once
in the program.  In our work, we were inlining functions used exactly
once, and the invariant is trivially preserved by this optimization.
In general beta reduction, binding occurrences are duplicated, and so
we have to do alpha renaming there.

I can't comment on how this compares in speed to de Bruijn indices.


-Trevor



  parent reply	other threads:[~2000-10-13 11:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-10 18:09 Greg Morrisett
2000-10-12 14:57 ` Chet Murthy
2000-10-12 18:08   ` Benjamin C. Pierce
2000-10-12 18:19   ` Trevor Jim [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-10-12 19:09 John R Harrison
2000-10-12 17:33 Greg Morrisett
2000-10-11 11:26 Simon Peyton-Jones
2000-10-11 20:12 ` Markus Mottl
2000-10-10 18:30 John R Harrison
2000-10-09  7:19 de Bruijn indices (Re: WWW Page of Team PLClub) Eijiro Sumii
2000-10-10 14:04 ` de Bruijn indices Gerard Huet
2000-10-10 17:29   ` Chet Murthy
2000-10-11 22:35     ` John Max Skaller
2000-10-05 23:29 Patrick M Doane
2000-10-06  8:15 ` Markus Mottl

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dr93di1c485.fsf@raptor.research.att.com \
    --to=trevor@research.att.com \
    --cc=caml-list@inria.fr \
    --cc=chet@watson.ibm.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 NNTP newsgroup(s).