From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: [r6rs-discuss] Implementors' intentions concerning R6RS
Date: Mon, 12 Nov 2007 21:51:48 +0100 [thread overview]
Message-ID: <874pfrjifv.fsf@chbouib.org> (raw)
In-Reply-To: 87ir475ht3.fsf@ossau.uklinux.net
Hi Neil,
Neil Jerram <neil@ossau.uklinux.net> writes:
> 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?
The current code is very tricky to work with. I once tried to change
environments to use vectors instead of lists so that `scm_ilookup ()'
would become O(N), but it proved hard to do and I eventually bailed out
(IIRC the issue that stopped me had to do with rest arguments handling,
currently handled by `SCM_CDRLOC', which assumes that a frame's
variables are contained in a list, if you see what I mean).
>> * 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).
Oh yes, you're right (these are two non-nested `for' loops).
>> * 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.
You're right too. :-)
Anyway, it looks like there are opportunity for performance
improvements, and that could be an opportunity to switch to a
compiled-to-C meta-circular interpreter (as seen in SICP).
(It looks like I'm "dreaming" too much compared to my free time, but I
hope others could adopt the idea!)
Thanks,
Ludovic.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2007-11-12 20:51 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
2007-11-12 20:51 ` Ludovic Courtès [this message]
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=874pfrjifv.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).