SGF Utils 0.10 available

2021-12-15 Thread Thien-Thi Nguyen

release notes:

  The source code dir (below) also includes a pair of SGF files
  you can use to (further) test SGF Utils programs.

README excerpt:

  SGF Utils is a set of programs for manipulating Smart Game
  Format files, principally for the game of Go.  This release
  includes three programs:

sgfc -- check well-formedness and style
sgfm -- "mogrify"
sgfv -- browse graphically
  
NEWS for 0.10 (2021-12-15):

  - sgfv: bugfixes in PASS rendering

PASS rendering (as a move itself, and when it is being labelled,
such as in a fork/variation) used to crash sgfv due to a type
mismatch error.  This is now fixed.  For PASS as a move, there is
no rendering (what a surprise!); for PASS as a labelled move, the
label is rendered in space, approximately mid-way (vertically)
down the board, with annotation "(PASS)".

In the distribution, you can see this in action by building
everything (do "configure" and "make"), and issuing the command:

 $ cd src && ./sgfv -g 800x400 sgf/b2

If All Goes Well, after you type "n" three times, you will see a
bodacious "2 (PASS)" and be ready to do "make install".  :-D

  - bootstrap/maintenance tools

upgraded:

 (none)

as before:

 Guile-BAUX 20211208.0839.a5245e7
 GNU gnulib 2021-12-10 21:54:54
 GNU Autoconf 2.71
 GNU Automake 1.16.5
 GNU Guile 2.2.7

source code:

  https://www.gnuvola.org/software/sgf-utils/

-- 
Thien-Thi Nguyen ---
 (defun responsep (query)   ; (2021) Software Libero
   (pcase (context query)   ;   = Dissenso Etico
 (`(technical ,ml) (correctp ml))
 ...))  748E A0E8 1CB8 A748 9BFA
--- 6CE4 6703 2224 4C80 7502



signature.asc
Description: PGP signature


Re: why I love scheme

2021-12-15 Thread Zelphir Kaltstahl
Hello Stefan!

This translates a recursive tree function into a tail recursive function.
However, in this case, I am not sure it is really worth doing, in comparison to
the naive (+ first-branch other-branch) solution. The reason is, that instead of
a call stack for multiple branches, you are only moving that stuff into a longer
and longer continuation, which will be on the stack in each recursive call.

However, I think you or other people on the list probably know more about this
than I do and about how the approaches compare in terms of memory and time.
Maybe the stack frames are more in size than the memory consumed by the overhead
of the continuation, or the other way around.

Regards,
Zelphir

On 12/15/21 12:44 AM, Stefan Israelsson Tampe wrote:
> Maybe you think the below program is trivial, but I adore named let's so
> much that I just cannot fathom that when people go functional they totally
> miss this beauty
>
>
> (define (count tree)
>
> ;; s = total sum up to now
>
> ;; t = tree of the type (car = child . cdr = siblings)
>
> ;; cont is the continuation, (cont 10) will continue
>
> ;; the calculation with the sum=10 see how we initiate
>
> ;; with a continuation that evaluates returns it's argument
>
>
> (let loop ((s 0) (t tree) (cont (lambda (s) s)))
>
> (if (pair? t)
>
> (loop s (car t) (lambda (s) (loop s (cdr t) cont)))
>
> (cont (if (number? t) t 0

-- 
repositories: https://notabug.org/ZelphirKaltstahl




Tastiera Dura 1.17 available

2021-12-15 Thread Thien-Thi Nguyen

release notes:

  Benvenuti a tutti i file .xpm!

LEGGIMI excerpt:

  Benvenuto a Tastiera Dura, un piccolo programma per
  divertire i bambini con forme, lettere ed immagini varie
  sul schermo in risposta ai dati della tastiera.  Si chiama
  "dura" perché oltre ai "tasti per uscire", non è possibile
  interrompere l'esecuzione del programma (in teoria).

NOTIZIE for 1.17 (2021-12-15):

  - immagini .xpm accettate

  - attrezzi bootstrap

aggiornati:

 Guile-BAUX 20211208.0839.a5245e7
 GNU gnulib 2021-12-10 21:54:54
 GNU Autoconf 2.71
 GNU Automake 1.16.5
 GNU texinfo 6.8

come prima:

 (nulla)

source code:

  https://www.gnuvola.org/software/tastiera-dura/

-- 
Thien-Thi Nguyen ---
 (defun responsep (query)   ; (2021) Software Libero
   (pcase (context query)   ;   = Dissenso Etico
 (`(technical ,ml) (correctp ml))
 ...))  748E A0E8 1CB8 A748 9BFA
--- 6CE4 6703 2224 4C80 7502



signature.asc
Description: PGP signature


Re: why I love scheme

2021-12-15 Thread Zelphir Kaltstahl
I did not know, that lambdas are allocated on the heap. I have a few questions 
now:

How does this affect using fibers? (And how do fibers work better in that case?)

The unrolling you mentioned. Would same not be possible for the
naive-but-not-tail-recursive version? Is the idea, that the continuation tail
recursive version does work better, because the compiler is somehow able to
optimize it better? If so, why?

I am asking, because I once had the same kind of problem and then read, that
instead of growing stack levels, I am growing the continuation, so not winning
anything. But perhaps that was wrong and I should have gone for the continuation
solution. I would like to be able to make an educated decision when next meeting
such a problem.

Best regards,
Zelphir


On 12/15/21 1:59 PM, Stefan Israelsson Tampe wrote:
> I believe that the lambda closures will be allocated from the heap and hence
> this procedure will
> be perfect if you are using fibers.. Also the compiler can do magic if it
> want's and unroll 
> and untangle a few iterations, so it can be very fast as well.My point is that
> the named let
> is such a nice  looping construct (try to do this with a for loop in java). I
> use it all the time
> and only sometimes I need to move to even more advanced constructs like 
> letrec. 
>
> On Wed, Dec 15, 2021 at 10:38 AM Zelphir Kaltstahl  > wrote:
>
> Hello Stefan!
>
> This translates a recursive tree function into a tail recursive function.
> However, in this case, I am not sure it is really worth doing, in
> comparison to
> the naive (+ first-branch other-branch) solution. The reason is, that
> instead of
> a call stack for multiple branches, you are only moving that stuff into a
> longer
> and longer continuation, which will be on the stack in each recursive 
> call.
>
> However, I think you or other people on the list probably know more about 
> this
> than I do and about how the approaches compare in terms of memory and 
> time.
> Maybe the stack frames are more in size than the memory consumed by the
> overhead
> of the continuation, or the other way around.
>
> Regards,
> Zelphir
>
> On 12/15/21 12:44 AM, Stefan Israelsson Tampe wrote:
> > Maybe you think the below program is trivial, but I adore named let's so
> > much that I just cannot fathom that when people go functional they 
> totally
> > miss this beauty
> >
> >
> > (define (count tree)
> >
> > ;; s = total sum up to now
> >
> > ;; t = tree of the type (car = child . cdr = siblings)
> >
> > ;; cont is the continuation, (cont 10) will continue
> >
> > ;; the calculation with the sum=10 see how we initiate
> >
> > ;; with a continuation that evaluates returns it's argument
> >
> >
> > (let loop ((s 0) (t tree) (cont (lambda (s) s)))
> >
> > (if (pair? t)
> >
> > (loop s (car t) (lambda (s) (loop s (cdr t) cont)))
> >
> > (cont (if (number? t) t 0
>
> -- 
> repositories: https://notabug.org/ZelphirKaltstahl
> 
>
-- 
repositories: https://notabug.org/ZelphirKaltstahl



Re: why I love scheme

2021-12-15 Thread Damien Mattei
hello Stefan,

i have had two Scheme teacher before graduating and being teaching scheme
too.
One tell us that basically CPS is the same as recursivity.
The other one said students to always give an example of the use of a
Scheme function of our own unless it did not read and give a note to our
work. ;-)
Damien

On Wed, Dec 15, 2021 at 9:32 PM Zelphir Kaltstahl <
zelphirkaltst...@posteo.de> wrote:

> I did not know, that lambdas are allocated on the heap. I have a few
> questions now:
>
> How does this affect using fibers? (And how do fibers work better in that
> case?)
>
> The unrolling you mentioned. Would same not be possible for the
> naive-but-not-tail-recursive version? Is the idea, that the continuation
> tail
> recursive version does work better, because the compiler is somehow able to
> optimize it better? If so, why?
>
> I am asking, because I once had the same kind of problem and then read,
> that
> instead of growing stack levels, I am growing the continuation, so not
> winning
> anything. But perhaps that was wrong and I should have gone for the
> continuation
> solution. I would like to be able to make an educated decision when next
> meeting
> such a problem.
>
> Best regards,
> Zelphir
>
>
> On 12/15/21 1:59 PM, Stefan Israelsson Tampe wrote:
> > I believe that the lambda closures will be allocated from the heap and
> hence
> > this procedure will
> > be perfect if you are using fibers.. Also the compiler can do magic if it
> > want's and unroll
> > and untangle a few iterations, so it can be very fast as well.My point
> is that
> > the named let
> > is such a nice  looping construct (try to do this with a for loop in
> java). I
> > use it all the time
> > and only sometimes I need to move to even more advanced constructs like
> letrec.
> >
> > On Wed, Dec 15, 2021 at 10:38 AM Zelphir Kaltstahl <
> zelphirkaltst...@posteo.de
> > > wrote:
> >
> > Hello Stefan!
> >
> > This translates a recursive tree function into a tail recursive
> function.
> > However, in this case, I am not sure it is really worth doing, in
> > comparison to
> > the naive (+ first-branch other-branch) solution. The reason is, that
> > instead of
> > a call stack for multiple branches, you are only moving that stuff
> into a
> > longer
> > and longer continuation, which will be on the stack in each
> recursive call.
> >
> > However, I think you or other people on the list probably know more
> about this
> > than I do and about how the approaches compare in terms of memory
> and time.
> > Maybe the stack frames are more in size than the memory consumed by
> the
> > overhead
> > of the continuation, or the other way around.
> >
> > Regards,
> > Zelphir
> >
> > On 12/15/21 12:44 AM, Stefan Israelsson Tampe wrote:
> > > Maybe you think the below program is trivial, but I adore named
> let's so
> > > much that I just cannot fathom that when people go functional they
> totally
> > > miss this beauty
> > >
> > >
> > > (define (count tree)
> > >
> > > ;; s = total sum up to now
> > >
> > > ;; t = tree of the type (car = child . cdr = siblings)
> > >
> > > ;; cont is the continuation, (cont 10) will continue
> > >
> > > ;; the calculation with the sum=10 see how we initiate
> > >
> > > ;; with a continuation that evaluates returns it's argument
> > >
> > >
> > > (let loop ((s 0) (t tree) (cont (lambda (s) s)))
> > >
> > > (if (pair? t)
> > >
> > > (loop s (car t) (lambda (s) (loop s (cdr t) cont)))
> > >
> > > (cont (if (number? t) t 0
> >
> > --
> > repositories: https://notabug.org/ZelphirKaltstahl
> > 
> >
> --
> repositories: https://notabug.org/ZelphirKaltstahl
>
>