From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Vong Newsgroups: gmane.lisp.guile.user Subject: Re: Can Guile be bootstrapped from source without psyntax-pp.scm? Date: Fri, 07 Jul 2017 22:00:24 +0800 Message-ID: <87podc1h53.fsf@gmail.com> References: <87d19dr3kx.fsf@gmail.com> <87inj5f2eg.fsf@netris.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1499436076 432 195.159.176.226 (7 Jul 2017 14:01:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 7 Jul 2017 14:01:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: guile-user@gnu.org, bootstrappable@freelists.org To: Mark H Weaver Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jul 07 16:01:09 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dTToa-0007qX-Bj for guile-user@m.gmane.org; Fri, 07 Jul 2017 16:01:00 +0200 Original-Received: from localhost ([::1]:56750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTTof-00044N-UY for guile-user@m.gmane.org; Fri, 07 Jul 2017 10:01:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTToI-000444-8W for guile-user@gnu.org; Fri, 07 Jul 2017 10:00:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTToF-0001mV-67 for guile-user@gnu.org; Fri, 07 Jul 2017 10:00:42 -0400 Original-Received: from mail-pg0-x234.google.com ([2607:f8b0:400e:c05::234]:36019) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dTToE-0001kj-Q8 for guile-user@gnu.org; Fri, 07 Jul 2017 10:00:38 -0400 Original-Received: by mail-pg0-x234.google.com with SMTP id u62so17686595pgb.3 for ; Fri, 07 Jul 2017 07:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ub+1f0UMmTzSzT+6DjVLd2JSdX111Q4hnvJ0Et+uUeM=; b=gPcqsPXSw6t5/NGy0PKew2XcIkHBwbTL/mzZ1rdPLm5i2/Y78BiVSN5equ2oq4D3lt Y5vgyWnou+WjPv+GSxlaTimhGf/PFl5IsIXwkUO2BYB6sJOsYLVUD4roxFdBQtpMq5Cy KZlbk3+C/BujDbeL0/SK2GyxB9xLIKvQHdvxXiU2Wcp2RLBfVzDQMJR222xN3cS9rKHb JAkVtHMiLnPK8WhGK6kf964RaPesSxNypHPASHgw3LEmRNkHFuBENuLmjAbqMS3bTprs YbERMZ1mjW07atzbP8ZW+hb3+xjPXm7X3e702jlRKmBJKJ24vzPzaas6YhUN2ojGjzjv /qMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ub+1f0UMmTzSzT+6DjVLd2JSdX111Q4hnvJ0Et+uUeM=; b=Fycxfqif2sczrWYkPoPs4i5+cm/e1wK+1unMOWKtRh87DUNsgbMPx4/BQlLLfMZ+QF P8SlCo1QHquS7mTqIFsUr+ahtq8PWr5tM1Ef3SeXOfQa8GnfUc9f/pdK/o+rgppDnaot SKq7SfNW12BEY3sncgFkewjfM4Tnij11gBFuOTsNW3BElIHV4lo7dW94FKyZTsWsQLAm BJZQ0wfg7iI43Wrks7G4lNrJQGfyxBtSGlvyZ1W9pOLEF6ZsVZcEdHPAnwfFy2ScgTQ9 cdGLR0wrk3YZHKBDXd9WAebQgIrQ5yISt+xkNqNhvRTf1es5SHO0Lu/mUsdbHTZDCrw2 D6wg== X-Gm-Message-State: AIVw111+8q0Q01JRtitMsdxDvflr4lrluJ1VqRxIhUz7/eueB2bgYNeX S4qZifd+1X0ouA== X-Received: by 10.84.224.74 with SMTP id a10mr3283724plt.210.1499436037747; Fri, 07 Jul 2017 07:00:37 -0700 (PDT) Original-Received: from debian (pcd372176.netvigator.com. [203.218.162.176]) by smtp.gmail.com with ESMTPSA id d70sm10352920pga.49.2017.07.07.07.00.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jul 2017 07:00:36 -0700 (PDT) In-Reply-To: <87inj5f2eg.fsf@netris.org> (Mark H. Weaver's message of "Thu, 06 Jul 2017 21:42:47 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::234 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13902 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Mark, Mark H Weaver writes: > Hi Alex, > > Alex Vong writes: > >> Recently, I've read the chapter on Macros in Guile's manual. The manual >> says that Guile's expander originated from that of Chez Scheme's and >> that version was portable to other schemes as well. So I search the >> Internet and find it[0]. The website states that the expander needs an >> expanded version of itself for bootstrapping, i.e. psyntax.ss needs >> psyntax.pp for bootstrapping. >> >> After playing for awhile, I realize the relationship of Guile's >> psyntax.scm and psyntax-pp.scm is exactly analogus. One needs an >> expanded version of psyntax.scm, i.e. psyntax-pp.scm for bootstrapping. >> >> Does this mean Guile is not bootstrappable from source only? > > That's correct. psyntax-pp.scm is not source code, and it is needed to > bootstrap Guile. However, I made an effort some years ago to make > psyntax-pp.scm far smaller and more readable than the corresponding file > from upstream psyntax. See: > > https://git.savannah.gnu.org/cgit/guile.git/commit/?h=3Dstable-2.0&id= =3D72ee0ef71b9a0514874976cdcf3ea9d5333db4b1 > https://git.savannah.gnu.org/cgit/guile.git/commit/?h=3Dstable-2.0&id= =3D1af6d2a717f499564fbbc297c79e00ac14b0dcf9 > I see. So it used to be worse --- several millions LOC. Now it is only ~3000, which is shorter than Emacs's bytecomp.el > At this point, I believe it would be quite feasible for a single hacker > to audit our psyntax-pp.scm and compare it to psyntax.scm within a > reasonable time frame. Furthermore, when we make local changes to > psyntax.scm, the corresponding changes to psyntax-pp.scm are localized > and quite easy to audit as well, so the full audit need not be repeated. > It is really good that small change in source --> small change in binary. A fancy way of saying it: the map between source and binary is in some sense "continuious". > Having said this, I agree that it would be better if psyntax.scm were > written in such a way that it could be bootstrapped without the use of > itself. Maybe some day we'll rewrite it to make it so. > Agree. For future interested readers: I can imagine one way of doing it: First implement a low-level hygienic macro expander without using macros and then write the syntax-case expander using low-level macros. To get started, you can watch the "Let's Build a Hygienic Macro Expander =E2=80=94 Strange Loop 2016, Matthew Flatt" video. > Mark Cheers, Alex --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEdZDkzSn0Cycogr9IxYq4eRf1Ea4FAllfk/gACgkQxYq4eRf1 Ea47xQ/+I5KQ8v6joo7IBVz37dzr2ooprxIXmO/jhIgRkijP0Agbvo5WsdsVNmor +HTDpWEkDHJkzJat2fo/39VorHKv5ZDr9A7kzJTBZe++b2U+rOPIVaM7vz/U8XCQ P7Ehl1OCsl74c3bNi7su+dD657vIvJ/r1sqHvZctsb86Ih/Tz/gFfus+DoQBEItt t0TCYaMJ8I7SLoRYgQFWhe4Zp42mJcO7oGENE9LnPwD4l0Zen5nhhInMe135XfDX zwZnqYZ4/r7Al8shORpDJo9gXwULR+lnu2qJ2pwL9ytNgaxeROk6JXfhSbHl9Ylo gBzptbYZNPs+00VNEvxcW1hpj4Oyrm52OSod/yEmFFyVvA4+CqT1TkzKftJmkAAc Q2ollRWd3wYPEqTtvUKVsHzlehr7rE9UUgVg+oP/v/Hu/xar7ht9MOB88SlwfF+Q 6D7jbUlrMTAlhzcKuf+Kc83cRNNrBoirkONN3NW6ZDtx9KggKTCWG07p0Xo5M/Sp bXbkBLQBAU1VPV/EgfqhgdR3mqrSVofdIVHIsALi24And9kVFjZIff0Nd/0jqhMi UneL4YJLTScUGe88XZURg7QB2X8cOa68/64/KABALKzirnHYoIAcrfdiV/gWE7rJ 3RUkS8hGP3QRwCLYLETsh05b5eAWvSAUkNXNSBwlSV/AQxbKgug= =6Ed4 -----END PGP SIGNATURE----- --=-=-=--