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

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.

>>   * 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:

  * 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;

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

I'm sure there's much to gain from these.  Implementing it in Scheme
would improve maintainability while keeping room for future
improvements.

> I'm pretty Unicode-ignorant, but I've read enough to think that this
> area is important.  Is the problem with the C API just that it has
> "char" everywhere?

Yes, mostly.  That said, I'm not sure exactly how the C I/O API would
need to be changed.

Thanks,
Ludovic.



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


  reply	other threads:[~2007-11-11 15:28 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 [this message]
2007-11-12 20:29                             ` Neil Jerram
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=87sl3c6bt6.fsf@chbouib.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@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).