From: Neil Jerram <neil@ossau.uklinux.net>
Cc: guile-devel@gnu.org
Subject: Re: Stack unwinding for C code
Date: 29 Dec 2003 23:25:33 +0000 [thread overview]
Message-ID: <m3pte7p5oy.fsf@laruns.ossau.uklinux.net> (raw)
In-Reply-To: <87ptea40wu.fsf@zagadka.ping.de>
>>>>> "Marius" == Marius Vollmer <mvo@zagadka.de> writes:
Marius> Neil Jerram <neil@ossau.uklinux.net> writes:
>> This looks nice - I'll take your word for it that we need this, and
>> the API looks clean as you say.
Marius> Don't you think we need it? Maybe I'm overlooking some obvious
Marius> alternative that would work just as well...
Sorry - I didn't mean that at all. I meant only that I hadn't
bothered to think so carefully about the requirement as about your
proposal to meet it. I am happy that this is a real requirement.
>> In API terms, this feels to me like the same area as issues like
>> SCM_DEFER_INTS, control of signal delivery, inhibiting thread
>> switching, etc. I realize that these are quite different mechanisms
>> really, but it would be lovely if the API that you are proposing here
>> could also cope with and document all those other areas once and for
>> all.
Marius> Hmm. I had to change the continuation stuff already: just disallowing
Marius> all construction and invocation of continuations is too restricitve:
Marius> continuations that are only used below the frame cause no harm. Only
Marius> continuations that cause the frame to be rewound need to be prevented.
Marius> This is too restrictive as well, in a sense, since continuations that
Marius> are only used in a suspend/resume way (for threads or coroutines, say)
Marius> are OK as well. But the general continuations are too general to know
Marius> how they are going to be used, so throwing an error when such a frame
Marius> is rewound is all we can do.
This all sounds fine, but I think doesn't address the point that I was
trying to make. My point was that it might be nice to extend your
proposed API so that it could cover the other tricky points in writing
Guile C code, some of which I listed above.
>> Perhaps "continuation-proof" or "continuation-protected"?
Marius> What about "rewindable"?
Yes! "rewindable" is excellent.
Marius> (I think that ultimately, we should have a different way of reporting
Marius> error from C code: we should not include the subr name in the call to
Marius> the error reporting function but rather rely on a more general
Marius> mechanism for providing a backtrace for C code. I found it attractive
Marius> to just combine it with the frame stuff, but it probably is too
Marius> early...)
You're probably right, but to be sure I suspect we need more
experiences from users using Guile's debugging tools first. I doubt
it's worth playing with this until we know more about what is really
useful.
Marius> - C Function: void scm_c_define_proc (const char *name,
Marius> int req, int opt,
Marius> int restp,
Marius> SCM (*proc) (...))
>>
>> This is not a good name: it is not helpful to suggest that "proc" =
>> "framed gsubr". How about scm_c_define_framed_gsubr ?
Marius> Hmm. That is so technical. I wanted to imply that scm_c_define_proc
Marius> is the usual way to export C procedures to Scheme. Even if you don't
Marius> explicitly ;) ask for a frame, you still get it since it is good for
Marius> you....
Marius> But, yeah, I'm removing this together with the label stuff.
I don't understand. It could still be useful for C procedures to be
non-rewindable by default, even if there isn't a label associated with
the framing. Do you think there is existing C code that uses
scm_c_define_gsubr and uses rewindability, such that we couldn't just
change scm_c_define_gsubr to enforce non-rewindability?
Hoping these comments help ...
Neil
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2003-12-29 23:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-26 21:36 Stack unwinding for C code Marius Vollmer
2003-12-27 9:53 ` tomas
2003-12-27 12:11 ` Neil Jerram
2003-12-27 17:37 ` Marius Vollmer
2003-12-28 2:25 ` Tom Lord
2003-12-29 22:12 ` Marius Vollmer
2003-12-29 23:25 ` Neil Jerram [this message]
2003-12-31 0:10 ` Marius Vollmer
2004-01-02 11:45 ` Dirk Herrmann
2004-01-02 17:38 ` Marius Vollmer
2004-01-03 22:08 ` Marius Vollmer
2004-01-10 11:45 ` Dirk Herrmann
2004-01-11 1:23 ` Marius Vollmer
2004-01-06 18:37 ` Paul Jarc
2004-01-07 20:27 ` Marius Vollmer
2004-01-13 17:24 ` Rob Browning
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=m3pte7p5oy.fsf@laruns.ossau.uklinux.net \
--to=neil@ossau.uklinux.net \
--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).