From: tomas@fabula.de
Cc: guile-user@gnu.org
Subject: Re: Doc organization (Re: Around again, and docs lead role)
Date: Mon, 12 May 2003 13:40:36 +0200 [thread overview]
Message-ID: <20030512114036.GA24481@www> (raw)
In-Reply-To: <m3fznn57tj.fsf@laruns.ossau.uklinux.net>
On Sat, May 10, 2003 at 01:01:44PM +0100, Neil Jerram wrote:
> >>>>> "tomas" == tomas <tomas@fabula.de> writes:
[...]
> Not sure I understand. Are you saying that the relationship between
> how one codes a primitive in C, and how one calls it in Scheme, should
> be clearly described? If so, I agree.
Uh, sorry for my unclear wording. I meant to say that I don't see the need
for repetition as long as there is a way to guess the C name and usage from
the Scheme counterpart -- just document the exceptions. OTOH, having separate
docs for C and Scheme would be OK; I guess the transformation might be
script-supported.
> >> That's what I'm thinking now, anyway. I think (**) may be quite
> >> controversial, so that at least needs a lot more discussion first.
>
> tomas> To take the other side of the controverse ;-)
[...]
> With ``recommended canonical way'' you've hit the nail on the head as
> far as I'm concerned. The main point of my whole argument is that
> there are currently no recommended ways of using Guile, and that makes
> it (i) jolly difficult to document - especially for more inexperienced
> developers (ii) difficult to clearly define the API and so manage API
> changes between releases.
Yup. (In a way, it seems to be a fundamental Scheme characteristic,
do-it-yourself everywhere ;-)
> To consider your example ... Although it might be most immediately
> natural to catch and dispatch errors at the C level, I would recommend
> a ``canonical'' organization like this: (I'm assuming here that the
> basic operation of mod_guile is to translate a mod_guile HTML page
> into vanilla HTML)
>
> - Define primitives that wrap the applications' mechanisms for
> reporting errors. Now you can signal those errors from Scheme.
>
> - Define a Scheme procedure that does the whole translation operation:
>
> (translate-page INPUT) -> OUTPUT
>
> This procedure can signal application errors as/when it needs to.
>
> - From C, just call out to translate-page, and return its result to
> Apache.
>
> This may be a bit harder to begin with than writing everything in C.
> But once this structure is in place, your scope for rapidly adding
> further enhancements is much greater, because all the interesting code
> is in Scheme, not C.
Hmmm. There is more to an Apache module than just generating a HTML page.
(And actually, it's this ``more'' which really makes a module worthwile
wrt a CGI scripts, besides performance, that is):
As a request traverses different stages of processing within the web
server, it calls specialized hooks within the module, so the module
can handle authentication, path resolving and what not.
Now imagine I could catch script errors from within the C caller:
I could install a simple error handler in C to deliver the proper
error code to the client browser -- independently of my scripting
language.
[pooled/transaction oriented memory allocation model]
> Sounds interesting, and maybe not too hard. Is the following
> possible?
>
> (let ((temp-heap (switch-to-new-heap)))
> ; This tell Guile's memory allocator to allocate a new heap
> ; and to make all memory allocations until further notice
> ; from this heap.
>
> (do-transaction-processing)
> ; During which all memory allocations come from the new heap.
>
> (gc-and-destroy-heap temp-heap)
> ; Perform a GC, assert that temp-heap now has nothing in use,
> ; destroy temp-heap and switch back to previous heap.
> )
Wow, this is very tempting :-)
Regards
-- tomas
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2003-05-12 11:40 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-26 7:33 Around again, and docs lead role Neil Jerram
2003-04-26 10:19 ` Thamer Al-Harbash
2003-04-27 20:56 ` Neil Jerram
[not found] ` <3E92E1B40021F4D7@pop3.tiscalinet.es>
2003-04-27 21:01 ` Neil Jerram
[not found] ` <3E92E1B4002B0632@pop3.tiscalinet.es>
2003-04-30 22:47 ` Neil Jerram
[not found] ` <3EAFE4EC000D9733@pop1.tiscalinet.es>
2003-05-07 21:06 ` Doc organization (Re: Around again, and docs lead role) Neil Jerram
2003-05-08 16:21 ` Rob Browning
2003-05-08 17:50 ` rm
2003-05-08 22:47 ` Neil Jerram
2003-10-28 16:09 ` Thien-Thi Nguyen
2003-05-08 22:36 ` Neil Jerram
2003-05-09 2:23 ` Rob Browning
2003-05-09 17:46 ` David Van Horn
2003-05-10 11:32 ` Neil Jerram
2003-05-15 16:02 ` Rob Browning
2003-05-15 16:33 ` Paul Jarc
2003-05-09 11:52 ` Bill Schottstaedt
2003-05-13 23:01 ` Neil Jerram
2003-05-14 1:07 ` Viktor Pavlenko
2003-05-14 14:29 ` Bill Schottstaedt
2003-05-15 7:55 ` Mikael Djurfeldt
2003-05-17 3:02 ` Max Techter
2003-05-09 8:15 ` tomas
2003-05-10 12:01 ` Neil Jerram
2003-05-12 11:40 ` tomas [this message]
2003-05-03 4:40 ` Around again, and docs lead role Robert Uhl
2003-05-03 11:34 ` rm
2003-05-03 22:21 ` Robert Uhl
2003-05-03 23:15 ` Thamer Al-Harbash
2003-05-04 8:40 ` David Allouche
2003-05-04 21:34 ` Robert Uhl
2003-05-04 19:47 ` rm
2003-05-04 21:42 ` Robert Uhl
2003-05-04 23:38 ` Thien-Thi Nguyen
2003-05-07 22:52 ` Neil Jerram
2003-05-08 22:32 ` State of Docs [was] " rm
2003-05-08 23:11 ` Neil Jerram
2003-05-10 0:47 ` State of Docs Kevin Ryde
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=20030512114036.GA24481@www \
--to=tomas@fabula.de \
--cc=guile-user@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).