From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Emacs Lisp revived Date: Wed, 10 Jun 2009 00:19:00 +0200 Message-ID: References: <4A2EC102.70304@domob.eu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1244585943 1590 80.91.229.12 (9 Jun 2009 22:19:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Jun 2009 22:19:03 +0000 (UTC) Cc: guile-devel@gnu.org To: Daniel Kraft Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jun 10 00:18:59 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ME9ek-00058f-HS for guile-devel@m.gmane.org; Wed, 10 Jun 2009 00:18:58 +0200 Original-Received: from localhost ([127.0.0.1]:53553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ME9ej-0005oU-KG for guile-devel@m.gmane.org; Tue, 09 Jun 2009 18:18:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ME9eg-0005kb-A9 for guile-devel@gnu.org; Tue, 09 Jun 2009 18:18:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ME9eb-0005Yv-8e for guile-devel@gnu.org; Tue, 09 Jun 2009 18:18:53 -0400 Original-Received: from [199.232.76.173] (port=60850 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ME9eb-0005Yj-5u for guile-devel@gnu.org; Tue, 09 Jun 2009 18:18:49 -0400 Original-Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:45294 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ME9ea-0003EZ-Tp for guile-devel@gnu.org; Tue, 09 Jun 2009 18:18:49 -0400 Original-Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 0185CBA4BF; Tue, 9 Jun 2009 18:18:48 -0400 (EDT) Original-Received: from unquote (unknown [81.39.159.16]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id ED40DBA4BE; Tue, 9 Jun 2009 18:18:45 -0400 (EDT) In-Reply-To: <4A2EC102.70304@domob.eu> (Daniel Kraft's message of "Tue, 09 Jun 2009 22:07:30 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 80CC2BD2-5543-11DE-AB68-97731A10BFE7-02397024!a-sasl-fastnet.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:8657 Archived-At: Howdy, On Tue 09 Jun 2009 22:07, Daniel Kraft writes: > I finally started real work on implementing the elisp compiler and just > pushed a first start-off code to branch elisp. It is however not yet > usable for anything, but also already has some very few things done. Yay!! I hope to have time to look at your branch soon :) > 1) In implementing all those special forms like progn, prog1, if, while, > ... I think it is best to translate a basic set directly to TreeIL via > the compiler, but also implement some (where that's reasonably possible) > simply as elisp macros (or even some things as functions). What do you > think about this plan? A core should compile to tree-il, and then you should be able to build the rest with macros. What fun, no? :) > 2) It seems that elisp uses nil as false value (and does not have a > dedicated false); so the question raises, should be then always use #f > for nil, or maybe TreeIL's void? Don't use void. You should use Guile's %nil, and we should have a make-nil instruction. %nil was added to Guile for precisely this purpose. > tree-il@(guile-user)> (if (void) (const 1) (const 2)) Oh yes, (void) is true indeed. (I'm happy you're using the tree-il repl btw, that's nice :) > Not related, but I came across it: (if (begin) 1 2) gives an error, > don't know if that's expected. Yes, it is an error. Surprising to me when I found that out, but even R5RS prohibits it. > 3) I still haven't got building lexical constructs in TreeIL working > (and I figure that named-lets for compiling the while-construct are even > more interesting), but will hopefully manage to do so soon... Ooh, sorry for not getting back to you about that. I'm sleepy now though ;) Here's some examples: scheme@(guile-user)> (use-modules (language tree-il)) scheme@(guile-user)> (unparse-tree-il (compile '(let ((x 10)) (+ x x)) #:to 'tree-il)) $3 = (let (x) (x33) ((const 10)) (apply (toplevel +) (lexical x x33) (lexical x x33))) scheme@(guile-user)> (unparse-tree-il (compile '(let ((x 10)) (+ x x)) #:to 'tree-il)) $4 = (let (x) (x34) ((const 10)) (apply (toplevel +) (lexical x x34) (lexical x x34))) scheme@(guile-user)> (unparse-tree-il (compile '(let ((x 10)) (+ x x)) #:to 'tree-il)) $5 = (let (x) (x35) ((const 10)) (apply (toplevel +) (lexical x x35) (lexical x x35))) scheme@(guile-user)> (compile '(let ((x 10)) (+ x x)) #:to 'tree-il) $6 = #< src: #f names: (x) vars: (x36) vals: (#< src: #f exp: 10>) body: #< src: #f proc: #< src: #f name: +> args: (#< src: #f name: x gensym: x36> #< src: #f name: x gensym: x36>)>> You see what changes and what does not? The gensyms are "fresh names" for the lexically bound vars. They are introduced in the binding constructs and included in the references. You can make a gensym with the `gensym' procedure. Happy hacking! Andy -- http://wingolog.org/