Re: [bootstrappable] Re: Can Guile be bootstrapped from source without psyntax-pp.scm?

2021-03-14 Thread Jan Nieuwenhuizen
Michael Schierl writes:

Hello,

> Jan Nieuwenhuizen wrote to guile-user@gnu.org[1] on 07 Jul 2017:
>> Mark H Weaver writes:
>>
 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.
>>
>> I'm facing the same problem with Mes.  I have an implemenation of
>> syntax-rules that is just about 200 lines of define-macro source code,
>> but not syntax case.
>
>>> 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.
>>
>> That could be essential to our full source bootstrapping efforts so I'm
>> very much interested!
>
> 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.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com



Re: [bootstrappable] Re: Can Guile be bootstrapped from source without psyntax-pp.scm?

2021-03-14 Thread Michael Schierl



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



[PATCH] fibers: operations for waiting until port is readable / writable

2021-03-14 Thread Maxime Devos
Hi guilers!

This is a patch to guile-fibers that adds
a ‘wait-until-port-readable-operation’ and
‘wait-until-port-writable-operation’ that can
be used to wait until a port (backed by a fd)
becomes readable or writabble respectively.

These operations can be used in combination
with e.g. get-operation, wait-operation and
sleep-operation using choice-operation.
Might be useful for implementing time-outs
and interrupts!

This is a revised version of a buggy patch I
previously posted:



I found the bug: I was trying to write to an input-only
port.  That's fixed now, and wait-until-port-X-operation
now verifies the port type.  I also added some documentation
and more tests.

"make distcheck" succeeds.

Greetings,
Maxime.


signature.asc
Description: This is a digitally signed message part