From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.devel Subject: Re: rtl playing with modules and lambda*'s Date: Tue, 11 Dec 2012 22:29:29 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1355236200 13369 80.91.229.3 (11 Dec 2012 14:30:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Dec 2012 14:30:00 +0000 (UTC) Cc: guile-devel To: Stefan Israelsson Tampe Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Dec 11 15:30:14 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TiQqa-0007kr-Bb for guile-devel@m.gmane.org; Tue, 11 Dec 2012 15:30:12 +0100 Original-Received: from localhost ([::1]:51946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiQqN-0003HU-NZ for guile-devel@m.gmane.org; Tue, 11 Dec 2012 09:29:59 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiQq2-0002NK-Jg for guile-devel@gnu.org; Tue, 11 Dec 2012 09:29:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiQpw-0008Qj-7J for guile-devel@gnu.org; Tue, 11 Dec 2012 09:29:38 -0500 Original-Received: from mail-ee0-f41.google.com ([74.125.83.41]:54134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiQpw-0008Oz-1H for guile-devel@gnu.org; Tue, 11 Dec 2012 09:29:32 -0500 Original-Received: by mail-ee0-f41.google.com with SMTP id d41so2545427eek.0 for ; Tue, 11 Dec 2012 06:29:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=T7JGd9pxguZ0iJtGTAlYirjXfUmRBmu+O4b0hILupso=; b=zc0v35fTEFNA/zSQx8rUqxRg2i1UVpTCWKPiA574a8zSxHCes8yrX3qwHTsyyMxJR/ B5bxIAas1ANMOEG2R77a0RzddPvwm45cr1l11UL47tbefgk61c5UWq9bQN5odUDtr7+B HZkFXKUuBWEs/WeNAnuG1vMqH+E866DCWxL1KrqI4qiEBd0RDyKfLgsgt+3vMTNtnu8d 93Of9ZyJupvzHoDCM4QneRzQeg685l3sV1ndfOcNcNFhrUVG/DJhmdrK0K5VEd/jsxWH ygcc56NVFWjUWFDe2pzgOGc3m4jIH+7uaYU/21Q1s8SU31M2fujkfoe9Ma6vm3HPGFsV lk3A== Original-Received: by 10.14.225.194 with SMTP id z42mr61267771eep.22.1355236169806; Tue, 11 Dec 2012 06:29:29 -0800 (PST) Original-Received: by 10.223.149.194 with HTTP; Tue, 11 Dec 2012 06:29:29 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 74.125.83.41 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:15329 Archived-At: On Mon, Dec 10, 2012 at 5:20 AM, Stefan Israelsson Tampe wrote: > Hi all, > > Until wingo starts coding we can only support him by learning the current > code base and learn what is needed in order > to finalize that work. Also shelving out bugs by exercising the code would > be nice. So I have this grand plan of compiling > the whole of guile to in rtl and use the tests already made, to find the > bugs, fix them and so on. > hi Stefan! It's very nice to see your passion, and I'm dealing with an naive AOT-compiler for Christmas hack. I think it has to be 'naive' before our RegisterVM come to a stage to be hacked from. I'll do it after the colored-REPL is done. This mail is nothing but an encouragment between us, and other guys who's interested in. ;-) I'll come soon, you're not alone. > So my latest endeavor have been into > > 1. Making modules work > 2. Making lambda* work > > To make this work one need to implement a few wrapper instructions, as > described in the previous mail. > Those are, > > (define-macro-assembler (toplevel-set asm dst val sym sm ss) > (let ((s (emit-non-immediate asm sym)) > (d (emit-non-immediate asm (current-module)))) > (emit-static-ref asm sm d) > (emit-static-ref asm ss s) > (emit-resolve asm dst sm ss) > (emit-box-set! asm dst val))) > > (define-macro-assembler (toplevel-define asm rsp val ss sym) > (let ((s (emit-non-immediate asm sym))) > (emit-static-ref asm ss s) > (emit-define asm rsp ss val))) > > (define-macro-assembler (module asm dst mod sym pred) > (let ((s (emit-non-immediate asm sym)) > (m (emit-non-immediate asm (cons pred mod))) > (v (intern-constant asm 0 #:slot #t))) > (emit-module-ref asm dst v m s))) > > (define-macro-assembler (module-set asm dst sm mod ss sym pred v) > (let ((s (emit-non-immediate asm sym)) > (m (emit-non-immediate asm mod)) > (p (if pred 1 0))) > (emit-static-ref asm sm m) > (emit-static-ref asm ss s) > (emit-resolve-module asm dst ss p) > (emit-resolve asm dst dst ss) > (emit-box-set! asm dst v))) > > (define-macro-assembler (keys-opt asm nreq nopts allow-other-keys? has-rest? > kw) > (let* ((nreq nreq) > (iao (if allow-other-keys? 1 0)) > (ihr (if has-rest? 2 0)) > (flags (+ iao ihr)) > (nreq+nopt (+ nopts nreq)) > (ntotal (+ nreq+nopt (length kw))) > (kw-ref (emit-non-immediate asm kw))) > (emit-bind-kwargs asm nreq flags nreq+nopt ntotal kw-ref))) > > As you can see the reference module operations are straightforward but the > set! is very verbose > and somewhat complex to use. Also the keys-opt one used to make lambda* > works is not but a simple wrapper that > construct the static data in order for the function to work as advertized. > > with this I can now compile srfi-1.scm to rtl and also the basics of modules > also seems to be in place! cool. > > So the next step would be to compile srfi-1 to actual rtl-value and start > thinking of testing the code for correctness as well. > > Have fun > /Stefan > > >