unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: [r6rs-discuss] Implementors' intentions concerning R6RS
Date: Mon, 12 Nov 2007 20:29:12 +0000	[thread overview]
Message-ID: <87ir475ht3.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <87sl3c6bt6.fsf@chbouib.org> (Ludovic Courtès's message of "Sun, 11 Nov 2007 16:28:53 +0100")

ludo@gnu.org (Ludovic Courtès) writes:

> Hi,
>
> Neil Jerram <neil@ossau.uklinux.net> writes:
>
>> I think I understand the point here, and it seems to me that this is
>> an improvement for the developer, not for the end user; and IMO not a
>> significant one (because it's pretty trivial to write a smob mark
>> function).  It also implies a performance cost, from scanning regions
>> of SMOB memory that Guile currently knows cannot contain heap
>> pointers.
>
> It really isn't that clear what performance impact libgc's pervasive
> scanning has.

Fair enough, let's wait and see what further investigation reveals.

>>>   * Rewrite the interpreter in Scheme (or a subset thereof), with a
>>>     tiny Scheme-to-C compiler.  That could be done in such a way that we
>>>     could re-use, e.g., the memoization and unmemoization code that
>>>     already exists in the first step.
>>
>> Interesting.  Do you think that that would be a lot faster than the C
>> code we have now?
>
> Note that whether it's implemented by hand in C or compiled to C doesn't
> make a significant difference.  The main optimizations I have in mind
> are the following:

These sound really interesting!  Do we need to wait for a rewrite of
the core interpreter, though, or could we try doing this in the
current code?

>   * heap-allocation-free closure invocations, which can be achieved by
>     storing a closure's arguments into a stack-allocated C array or,
>     even better, in registers (of course, invoking closures with rest
>     arguments would still require allocating an argument list);
>
>   * O(1) ILOC lookup, compared to the current O(N * M) algorithm, where
>     N is the frame number and M the position of the variable within that
>     frame's environment;

Are you sure the current algorithm is O(N*M)?  I would have said
O(N+M).

>   * no C function call overhead for tail(-recursive) calls.

I thought that was mostly achieved already, by extensive use of
gotos.  But I guess there must be important cases that I've not
noticed.

Regards,
        Neil



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2007-11-12 20:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <818B5317-4F09-46F3-9376-43292CEB3C16@iro.umontreal.ca>
     [not found] ` <200710261850.l9QIo8Vu017241@garbo.cs.indiana.edu>
     [not found]   ` <Pine.LNX.4.61.0710261701241.9685@tesseract.thetesseract.org>
     [not found]     ` <47229C5E.8070406@emf.net>
     [not found]       ` <Pine.LNX.4.61.0710280508300.19352@tesseract.thetesseract.org>
2007-10-28 18:16         ` [r6rs-discuss] Implementors' intentions concerning R6RS Neil Jerram
2007-10-28 18:29           ` Elf
     [not found]           ` <Pine.LNX.4.61.0710281146460.32075@tesseract.thetesseract.org>
2007-10-28 19:28             ` Neil Jerram
2007-10-29 15:30               ` Ludovic Courtès
2007-10-29 21:51                 ` Neil Jerram
2007-10-30  9:50                   ` Ludovic Courtès
2007-10-30 15:01                     ` Julian Graham
2007-10-30 23:15                       ` Neil Jerram
2007-10-31 14:55                         ` Julian Graham
2007-10-31 13:12                       ` Ludovic Courtès
2007-11-06 21:54                         ` Neil Jerram
2007-11-11 15:28                           ` Ludovic Courtès
2007-11-12 20:29                             ` Neil Jerram [this message]
2007-11-12 20:51                               ` Ludovic Courtès
2007-10-30 22:53                     ` Neil Jerram
2007-10-31 10:30                       ` Ludovic Courtès
2007-11-02 20:53                       ` Klaus Schilling
2007-11-03 11:14                         ` Ludovic Courtès
2007-11-03 17:49                           ` Klaus Schilling
2007-10-30 23:55               ` Andy Wingo
2007-11-03 18:15           ` Klaus Schilling
2007-11-04 12:39             ` Ludovic Courtès

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=87ir475ht3.fsf@ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    /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).