unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Michael Schierl <schierlm@gmx.de>
To: Jan Nieuwenhuizen <janneke@gnu.org>
Cc: guix-devel@gnu.org, guile-user@gnu.org, bootstrappable@freelists.org
Subject: Re: [bootstrappable] Re: Can Guile be bootstrapped from source without psyntax-pp.scm?
Date: Sun, 14 Mar 2021 15:18:13 +0100	[thread overview]
Message-ID: <41f000ed-1ca3-3b94-0358-ee4ce6ba99a0@gmx.de> (raw)
In-Reply-To: <87tupdg7nr.fsf@gnu.org>


Hello Jan,


Am 14.03.2021 um 14:57 schrieb Jan Nieuwenhuizen:
> Michael Schierl writes:
>
> Hello,
>
>> For the record, I have written a psyntax implementation that can be used
>> by Guile (3.0.2) and does not require an expanded version of itself.
>
> Oh, that's amazing!  I see that you are using make-syntax-transformer
> (and others) which GNU Mes does not support yet; it only has
> define-macro.  This may be a good reason/opportunity to work towards
> better Guile support in Mes.

In fact, I use make-syntax-transformer only because Guile does not have
native define-macro support (it uses psyntax to emulate it).

When there is native define-macro support, you can replace step1.scm by

(define s1*-define-macro define-macro)

(define-macro (s1*-expand-with-side-effects seff1 body seff2)
   (list '(lambda (a b . c) (apply values b))
         seff1
         (list 'call-with-values (list 'lambda '() body)
               '(lambda rest rest))
         seff2))

which will make the bootstrap even shorter.

Probably you should validate whether the evaluation order is right so
that s1*-expand-with-side-effects will really expand the side effect 1
before the body and side effect 2 after the body (there is an example in
psyntax-bootstrapping.scm line 76 which should display 1 2 3 and return 42).

You can skip step 2 as well, as you already have a quasiquote expander
that does not rely on psyntex.

The further steps up to step 7 will not use make-syntax-transformer, it
will come back in step 8 (patched psyntax.scm). But probably for step 8
you would have to patch your own psyntax.scm instead of patching guile's
version anyway.


Regards,


Michael



  reply	other threads:[~2021-03-14 14:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-13 22:42 Can Guile be bootstrapped from source without psyntax-pp.scm? Michael Schierl
2021-03-14 13:57 ` [bootstrappable] " Jan Nieuwenhuizen
2021-03-14 14:18   ` Michael Schierl [this message]
2021-03-15 17:09 ` Ludovic Courtès
2021-03-15 19:50   ` Michael Schierl
2021-03-16  8:59     ` Andy Wingo
2021-05-13 20:22       ` Michael Schierl
2021-03-17 17:25     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41f000ed-1ca3-3b94-0358-ee4ce6ba99a0@gmx.de \
    --to=schierlm@gmx.de \
    --cc=bootstrappable@freelists.org \
    --cc=guile-user@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=janneke@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).