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: vm status update Date: Sat, 13 Sep 2008 17:59:12 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221321612 30048 80.91.229.12 (13 Sep 2008 16:00:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Sep 2008 16:00:12 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Sep 13 18:01:08 2008 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 1KeXYK-0006yj-9Z for guile-devel@m.gmane.org; Sat, 13 Sep 2008 18:00:52 +0200 Original-Received: from localhost ([127.0.0.1]:60880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeXXJ-0007pQ-HW for guile-devel@m.gmane.org; Sat, 13 Sep 2008 11:59:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeXXA-0007m5-SE for guile-devel@gnu.org; Sat, 13 Sep 2008 11:59:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeXXA-0007lR-30 for guile-devel@gnu.org; Sat, 13 Sep 2008 11:59:40 -0400 Original-Received: from [199.232.76.173] (port=40687 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeXX9-0007lJ-MD for guile-devel@gnu.org; Sat, 13 Sep 2008 11:59:39 -0400 Original-Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:41614 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KeXX9-0005Ty-7R for guile-devel@gnu.org; Sat, 13 Sep 2008 11:59:39 -0400 Original-Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 00B1161A4D for ; Sat, 13 Sep 2008 11:59:39 -0400 (EDT) Original-Received: from unquote (177.Red-83-34-179.dynamicIP.rima-tde.net [83.34.179.177]) (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 32CBE61A4C for ; Sat, 13 Sep 2008 11:59:38 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Pobox-Relay-ID: F83A121C-81AC-11DD-8B6F-D0CFFE4BC1C1-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:7683 Archived-At: Hello, A small update. Since I wrote last, the compiler now puts program names in with program metadata, and programs print in a much more human-readable fashion: scheme@(guile-user)> module-ref $2 = # Some bugs were fixed in disassembly, allowing the addition of the following two sections: scheme@(guile-user)> ,x module-ref [...] Arguments: 0 local[0]: module 1 local[1]: name 2 local[2]: rest Bindings: 8-58 local[3]: variable [...] The arguments show how they are allocated. All local variables in a frame are on the stack, within the frame structure, and are accessed by index. The other possibility is that a variable is "external", that is, lexically bound by some enclosed lambda -- these are allocated on the heap. The range on the left side of a bindings listing shows the range of instructions in which that particular local variable is bound, and what its name is. Currently, local variables are not reused even if their dynamic extents are non-contiguous -- an optimization to maybe make later. For example: scheme@(guile-user)> ,x (lambda () (let ((x 1)) x) (let ((y 2)) y)) Disassembly of #: nargs = 0 nrest = 0 nlocs = 2 nexts = 0 Bytecode: 0 (make-int8 1) ;; 1 2 (local-set 0) 4 (make-int8 2) ;; 2 6 (local-set 1) 8 (local-ref 1) 10 (return) Bindings: 2-4 local[0]: x 6-11 local[1]: y ;; could reuse local 0 Sources: 2 #(0 14 #f) 6 #(0 30 #f) It seems that the argument printing code has a bug there -- nargs is 0, but it still prints the program as having args (x). An important bug was fixed when compiling `or' forms when the value would be discarded, as in `(begin (or #t (error "what")) 4)' -- an extra value would be left on the stack. You should recompile all your .go files when you pull. Currently I'm working on implementing multiple-values support, mostly as in Ashley and Dybvig's paper, http://repository.readscheme.org/ftp/papers/jmashley/lfp94.pdf. Instead of having the multiple-value return address being a fixed offset behind the normal return address in the instruction stream, however, I'm just going to push the MV return address on the stack, behind the normal return address. If you are interested in helping with guile-vm, just download it and give it a whirl, see if it works for you. If your program doesn't do call/cc it should work fine. I'm interested in any bugs! Cheers, Andy -- http://wingolog.org/