From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Patches for wip-rtl Date: Sat, 20 Apr 2013 19:30:55 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=bcaec520eeb561b2ca04dad33b22 X-Trace: ger.gmane.org 1366500684 23827 80.91.229.3 (20 Apr 2013 23:31:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Apr 2013 23:31:24 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Apr 21 01:31:28 2013 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 1UThFb-0007gN-GL for guile-devel@m.gmane.org; Sun, 21 Apr 2013 01:31:23 +0200 Original-Received: from localhost ([::1]:44914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UThFa-00068z-GN for guile-devel@m.gmane.org; Sat, 20 Apr 2013 19:31:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UThFX-00068u-8g for guile-devel@gnu.org; Sat, 20 Apr 2013 19:31:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UThFV-0001FN-SC for guile-devel@gnu.org; Sat, 20 Apr 2013 19:31:19 -0400 Original-Received: from mail-da0-x230.google.com ([2607:f8b0:400e:c00::230]:51655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UThFV-0001DB-Ik for guile-devel@gnu.org; Sat, 20 Apr 2013 19:31:17 -0400 Original-Received: by mail-da0-f48.google.com with SMTP id f10so855330dak.35 for ; Sat, 20 Apr 2013 16:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:from:date:x-google-sender-auth :message-id:subject:to:content-type; bh=O3JSzyWJhajokuoiUnTKnn7TiP0t9w4ID1GEUfiud6c=; b=EFhjNq+V1UPgXbqk6qiuE6ayaZb7TX22XcwJkmtdiHqQLng4WCoV84zkPFRbiNoN09 jcZsDZfD8BuMNkXjE4K4/dNvzGpO18/ax2NP5Bg0wgiBEA1xKup3gDzUhYoMmen4qS1j 6bcdpGSl/puPjCpREdRqH8CTDX+v1wXlEQbne7gdmUs1VK6XwLb/y3GF5arly/eAzdlc HMj8ZG+i+tMSxQoGzIl67S2etEsMlsEp6GChom0dLqRSL31DxBohIsspWAxTKFALOEj2 zK7kvVhp5uNpzIwTiRTG8YMno/Yg7gLMGK9ENDMECZp4BTDioyJZTdmpVpC7R07IrQuI V6mQ== X-Received: by 10.68.13.135 with SMTP id h7mr25426798pbc.113.1366500676054; Sat, 20 Apr 2013 16:31:16 -0700 (PDT) Original-Received: by 10.68.7.9 with HTTP; Sat, 20 Apr 2013 16:30:55 -0700 (PDT) X-Google-Sender-Auth: kt_5UA4de2p1O8a3BPZDOs-KrU8 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c00::230 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:16278 Archived-At: --bcaec520eeb561b2ca04dad33b22 Content-Type: multipart/alternative; boundary=bcaec520eeb561b2c604dad33b20 --bcaec520eeb561b2c604dad33b20 Content-Type: text/plain; charset=ISO-8859-1 Hello, I've attached three patches for wip-rtl. The first is somewhat different than the other two: it fixes an error that occurred when moving the linker to its own file. (system vm rtl) and (system vm linker) both contain a function called link-string-table, and (system vm rtl) was calling the wrong one, which made rtl.test fail. I solved this with an @-reference. The second two provide better VM errors when box-ref and box-set! are called on something that is not a variable. In particular, they throw an exception instead of aborting. This could occur in user code, if the user wants to hand-write RTL code, but it's also very useful in trying a new compiler implementation. The first patch handles box-ref, and the second handles box-set!. Also note that I had to add a new type of exception to (test-suite lib) to catch these errors. Lastly, I'd like to ask for ideas on how to test for errors in VM instructions that don't cause immediate problems, but do put the VM in an inconsistent state. I know of a collection of these errors, and while I could fix them, I'd rather fix them and add a test for them. I can think of two possibilities off the top of my head: 1) add Scheme accessors for VM state (I don't think mutators are necessary for now) or 2) write the tests in C instead of Scheme. I'd prefer option 1, mostly because I think that making the VM state more explicit is a good direction to go in anyway - eventually it would be great if the debugger could print the contents of registers, and that would require VM introspection anyway, so I think starting now is good. What do other people think of the patches and the ideas? Best, Noah --bcaec520eeb561b2c604dad33b20 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,

I've attached t= hree patches for wip-rtl. The first is somewhat different than the other tw= o: it fixes an error that occurred when moving the linker to its own file. = (system vm rtl) and (system vm linker) both contain a function called link-= string-table, and (system vm rtl) was calling the wrong one, which made rtl= .test fail. I solved this with an @-reference.

The second two provide better VM errors when box-ref and box-set!= are called on something that is not a variable. In particular, they throw = an exception instead of aborting. This could occur in user code, if the use= r wants to hand-write RTL code, but it's also very useful in trying a n= ew compiler implementation. The first patch handles box-ref, and the second= handles box-set!. Also note that I had to add a new type of exception to (= test-suite lib) to catch these errors.

Lastly, I'd like to ask for ideas on how to test for errors i= n VM instructions that don't cause immediate problems, but do put the V= M in an inconsistent state. I know of a collection of these errors, and whi= le I could fix them, I'd rather fix them and add a test for them. I can= think of two possibilities off the top of my head: 1) add Scheme accessors= for VM state (I don't think mutators are necessary for now) or 2) writ= e the tests in C instead of Scheme.

I'd prefer option 1, mostly because I think that making the VM stat= e more explicit is a good direction to go in anyway - eventually it would b= e great if the debugger could print the contents of registers, and that wou= ld require VM introspection anyway, so I think starting now is good.

What do other people think of the patches and the ideas?

<= /div>Best,
Noah
--bcaec520eeb561b2c604dad33b20-- --bcaec520eeb561b2ca04dad33b22 Content-Type: application/octet-stream; name="0001-Bugfix-in-rtl.scm.patch" Content-Disposition: attachment; filename="0001-Bugfix-in-rtl.scm.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hfrf735x0 RnJvbSBlZGRlY2RiMDU3NzI0MDE2Mzc5YjY5YzVlMzc3ZDZmZjEzNDUwNTk0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBOb2FoIExhdmluZSA8bm9haC5iLmxhdmluZUBnbWFpbC5jb20+ CkRhdGU6IFNhdCwgMjAgQXByIDIwMTMgMTg6Mjc6NDggLTA0MDAKU3ViamVjdDogW1BBVENIIDEv M10gQnVnZml4IGluIHJ0bC5zY20KCiogbW9kdWxlL3N5c3RlbS92bS9ydGwuc2NtOiBmaXggdGVz dCBlcnJvcnMgc3RlbW1pbmcgZnJvbSB0d28gZnVuY3Rpb25zCiAgd2l0aCB0aGUgc2FtZSBuYW1l LgotLS0KIG1vZHVsZS9zeXN0ZW0vdm0vcnRsLnNjbSB8ICAgIDUgKysrKy0KIDEgZmlsZSBjaGFu Z2VkLCA0IGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24oLSkKCmRpZmYgLS1naXQgYS9tb2R1bGUv c3lzdGVtL3ZtL3J0bC5zY20gYi9tb2R1bGUvc3lzdGVtL3ZtL3J0bC5zY20KaW5kZXggNjEyNmUw ZC4uNzcwMzlhYSAxMDA2NDQKLS0tIGEvbW9kdWxlL3N5c3RlbS92bS9ydGwuc2NtCisrKyBiL21v ZHVsZS9zeXN0ZW0vdm0vcnRsLnNjbQpAQCAtNzc3LDcgKzc3NywxMCBAQAogKGRlZmluZSAobGlu ay1zdHJpbmctdGFibGUgYXNtKQogICAoaW50ZXJuLXN0cmluZyEgYXNtICIuc2hzdHJ0YWIiKQog ICAobWFrZS1vYmplY3QgYXNtICcuc2hzdHJ0YWIKLSAgICAgICAgICAgICAgIChsaW5rLXN0cmlu Zy10YWJsZSAoYXNtLXN0cmluZy10YWJsZSBhc20pKQorICAgICAgICAgICAgICAgOzsgZGVsZWdh dGUgdG8gYSBmdW5jdGlvbiB3aXRoIHRoZSBzYW1lIG5hbWUgYnV0IGEKKyAgICAgICAgICAgICAg IDs7IGRpZmZlcmVudCBpbXBsZW1lbnRhdGlvbgorICAgICAgICAgICAgICAgKChAIChzeXN0ZW0g dm0gbGlua2VyKSBsaW5rLXN0cmluZy10YWJsZSkKKyAgICAgICAgICAgICAgICAoYXNtLXN0cmlu Zy10YWJsZSBhc20pKQogICAgICAgICAgICAgICAgJygpICcoKQogICAgICAgICAgICAgICAgIzp0 eXBlIFNIVF9TVFJUQUIgIzpmbGFncyAwKSkKIAotLSAKMS43LjEwLjQKCg== --bcaec520eeb561b2ca04dad33b22 Content-Type: application/octet-stream; name="0002-Better-Exception-in-RTL-VM.patch" Content-Disposition: attachment; filename="0002-Better-Exception-in-RTL-VM.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hfrf737p1 RnJvbSBjZTQ0MTEyM2JiZDNjMzJhMGIxYTE0NjE4YjdjZGM5NDA1ZGY3MzBlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBOb2FoIExhdmluZSA8bm9haC5iLmxhdmluZUBnbWFpbC5jb20+ CkRhdGU6IFNhdCwgMjAgQXByIDIwMTMgMTg6NTc6MDEgLTA0MDAKU3ViamVjdDogW1BBVENIIDIv M10gQmV0dGVyIEV4Y2VwdGlvbiBpbiBSVEwgVk0KCiAqIGxpYmd1aWxlL3ZtLWVuZ2luZS5jOiBp biBib3gtcmVmLCB0aHJvdyBhbiBleGNlcHRpb24gaW5zdGVhZCBvZgogICBhYm9ydGluZyB3aGVu IHRoZSByZWdpc3RlciBkb2VzIG5vdCBjb250YWluIGEgd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lcmljYWwtb3ZlcmZsb3cg Il5OdW1lcmljYWwgb3ZlcmZsb3ciKSkKIChkZWZpbmUgZXhjZXB0aW9uOnN0cnVjdC1zZXQhLWRl bmllZApkaWZmIC0tZ2l0IGEvdGVzdC1zdWl0ZS90ZXN0cy9ydGwudGVzdCBiL3Rlc3Qtc3VpdGUv dGVzdHMvcnRsLnRlc3QKaW5kZXggMjE5NDA3Yy4uNjMzNDI1YyAxMDA2NDQKLS0tIGEvdGVzdC1z dWl0ZS90ZXN0cy9ydGwudGVzdAorKysgYi90ZXN0LXN1aXRlL3Rlc3RzL3J0bC50ZXN0CkBAIC0y NDcsMyArMjQ3LDEyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGVuZC1wcm9ncmFt KSkpKSkKICAgICAgICAgICAgICAgICAgICAgKChtYWtlLXRvcC1pbmNyZW1lbnRvcikpCiAgICAg ICAgICAgICAgICAgICAgICp0b3AtdmFsKikpKSkKKworKHdpdGgtdGVzdC1wcmVmaXggImJveC1y ZWYiCisgIChwYXNzLWlmLWV4Y2VwdGlvbiAiYmFkIHZhcmlhYmxlIiBleGNlcHRpb246bm90LWEt dmFyaWFibGUKKyAgICAoKGFzc2VtYmxlLXByb2dyYW0KKyAgICAgICcoKGJlZ2luLXByb2dyYW0g Zm9vKQorICAgICAgICAoYXNzZXJ0LW5hcmdzLWVlL2xvY2FscyAwIDIpCisgICAgICAgIChib3gt cmVmIDAgMSkKKyAgICAgICAgKHJldHVybiAwKQorICAgICAgICAoZW5kLXByb2dyYW0pKSkpKSkK LS0gCjEuNy4xMC40Cgo= --bcaec520eeb561b2ca04dad33b22 Content-Type: application/octet-stream; name="0003-Better-Exception-in-RTL-VM.patch" Content-Disposition: attachment; filename="0003-Better-Exception-in-RTL-VM.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hfrf738a2 RnJvbSAyODI4ZjZmM2VjOWZhNzZlN2JiMzhmMDNkOGRiZDU0YzQwMzY5ODk4IE1vbiBTZXAgMT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