From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: tomas@fabula.de Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: Doc organization (Re: Around again, and docs lead role) Date: Mon, 12 May 2003 13:40:36 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <20030512114036.GA24481@www> References: <3E92E1B4002B0632@pop3.tiscalinet.es> <3EAFE4EC000D9733@pop1.tiscalinet.es> <20030509081556.GB5437@www> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1052738805 27256 80.91.224.249 (12 May 2003 11:26:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 12 May 2003 11:26:45 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon May 12 13:26:43 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19FBS7-00075P-00 for ; Mon, 12 May 2003 13:26:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19FBPY-0006IM-01 for guile-devel@m.gmane.org; Mon, 12 May 2003 07:24:04 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19FBKD-0004jF-00 for guile-devel@gnu.org; Mon, 12 May 2003 07:18:33 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19FBFM-0002vc-00 for guile-devel@gnu.org; Mon, 12 May 2003 07:13:34 -0400 Original-Received: from [217.22.192.104] (helo=www.elogos.de) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19FBCx-0001ss-00; Mon, 12 May 2003 07:11:03 -0400 Original-Received: by www.elogos.de (Postfix, from userid 5002) id E36991457F; Mon, 12 May 2003 13:40:36 +0200 (CEST) Original-To: Neil Jerram Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.3i Original-cc: guile-devel@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2337 gmane.lisp.guile.user:1940 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1940 On Sat, May 10, 2003 at 01:01:44PM +0100, Neil Jerram wrote: > >>>>> "tomas" == tomas 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