From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.devel Subject: Re: redoing SCM representation in 2.2 Date: Thu, 12 May 2011 14:50:51 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e68dea5096b31104a313a38f X-Trace: dough.gmane.org 1305204663 15272 80.91.229.12 (12 May 2011 12:51:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 12 May 2011 12:51:03 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu May 12 14:50:56 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QKVLz-0004uq-Kq for guile-devel@m.gmane.org; Thu, 12 May 2011 14:50:55 +0200 Original-Received: from localhost ([::1]:36786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKVLz-0001cG-8f for guile-devel@m.gmane.org; Thu, 12 May 2011 08:50:55 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKVLw-0001c9-UG for guile-devel@gnu.org; Thu, 12 May 2011 08:50:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKVLw-0007Wm-1k for guile-devel@gnu.org; Thu, 12 May 2011 08:50:52 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:48939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKVLv-0007Wg-Pn for guile-devel@gnu.org; Thu, 12 May 2011 08:50:52 -0400 Original-Received: by iwg8 with SMTP id 8so1916808iwg.0 for ; Thu, 12 May 2011 05:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=0hvIMmGHEX6BVYE1vmK5gbr8flCfmte9SKT6REozHIo=; b=TAQRr80i0W5/fidoEINOLYhmPUDtPYT/ejIJTqQ4j1r0O2Qmz2ALnKhk1NdsJmdkeE 4XhSDkkkSMGGBmcF9IY1NFnNjYpaNcwR4MgbAQ4wQEwASbLI2wwET12pUQX0jE7Guiio ekmKxNFWk35l0LbYELD6ptKzXRjshntZc4uHg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=bnX/THYlMjxmjbSsOY0Tl2yfd8FHOU5cdCF2+QLUi5+hw3awtApAz0J/jN2cINILtD TkDhYzVwY2usK+YDP64ETGPm4jlE1JechKAu8jPiSI/6X+jQz9EdO7jUCYViNCmht106 Jp2U8ANijSIy7w3OzOA6wd+8k3nKco3whz9ok= Original-Received: by 10.231.210.148 with SMTP id gk20mr121137ibb.110.1305204651110; Thu, 12 May 2011 05:50:51 -0700 (PDT) Original-Received: by 10.231.184.70 with HTTP; Thu, 12 May 2011 05:50:51 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.169 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12484 Archived-At: --0016e68dea5096b31104a313a38f Content-Type: text/plain; charset=ISO-8859-1 Looks interesting. I would like to reserve an object for the stack machine I use. Actually I will be fine to model the prolog engine ontop of your segestion if it was not for one idea. So you have a layout of this (X Tag14 Data Tag8) Consider a the following tag in Tag14, frame-tag. Then Data is a frame number and the next 8 bytes is a SCM value. The idea is to use a set! like function, like (frame-set! Frame FrameObj Val) and use it like (let ((fr (newframe))) (frame-set! *fluid* 1) ... (frame-set! *fluid* 2) ... (frame-set! *fluid* 3) (unwind fr)) (define (new-frame) (set! *fr* (+ *fr* 1)) *fr*) So with mem layout, *fluid* : [Fr SCM] Fr : [X frame-tag Data Tag8] SCM : [X Tag14 Data Tag8] (define (frame-set! d val) (if (not (eq? *fr* d.Fr.Data)) (begin (set! f.Fr.Data *fr*) (add-to-stack d)) (set! f.SCM val)) e.g. we can manage an automatic selection between a set-fluid! and with-fluid semantics and control it by using newframe and unwind which is more logical in the prolog context. The tagging is useful because that we will now directly that we are hitting on an element of meta information and the actual data can be reached in the next comming bytes. How about reserving one tag in Tag14 to repressent (X Tag14-xtra TagX Data) where Data is 32 bit and allow it to be used by applications? /Stefan --0016e68dea5096b31104a313a38f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Looks interesting.

I would like to reserve an object for the stack m= achine I use. Actually I will be fine to model the prolog
engine ontop = of your segestion if it was not for one idea.

So you have a layout o= f this
(X Tag14 Data Tag8)

Consider a the following tag in Tag14, frame-tag= . Then Data is a frame number and the next 8 bytes is a SCM value.
The i= dea is to use a set! like function, like

(frame-set! Frame FrameObj = Val)

and use it like
(let ((fr (newframe)))
=A0 (frame-set! *fluid* 1)=
=A0 ...
=A0 (frame-set! *fluid* 2)=A0=A0=A0
=A0 ...
=A0 (fram= e-set! *fluid* 3)
=A0 (unwind fr))


(define (new-frame)
=A0= (set! *fr* (+ *fr* 1))
=A0 *fr*)

So with mem layout,
*fluid* : [Fr SCM]
Fr=A0=A0=A0= =A0=A0 : [X frame-tag Data Tag8]
SCM=A0=A0=A0=A0 : [X Tag14=A0=A0=A0=A0 = Data Tag8]

(define (frame-set! d val)
=A0=A0 (if (not (eq? *fr*= =A0 d.Fr.Data))
=A0=A0=A0=A0=A0=A0 (begin
=A0=A0=A0 =A0(set! f.Fr.Data *fr*)
=A0=A0=A0 =A0(add-to-stack d))
=A0= =A0 (set! f.SCM val))

e.g. we can manage an automatic selection betw= een a set-fluid! and with-fluid
semantics and control it by using newfra= me and unwind which is more logical in
the prolog context. The tagging is useful because that we will now directly= that
we are hitting on an element of meta information and the actual da= ta can be
reached in the next comming bytes. How about reserving one tag= in Tag14 to
repressent=A0 (X Tag14-xtra TagX Data) where Data is 32 bit and allow it to= be
used by applications?

/Stefan

--0016e68dea5096b31104a313a38f--