From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catonano Subject: Re: my latest blog post Date: Sat, 9 Jun 2018 15:03:02 +0200 Message-ID: References: <87bmcmzfyz.fsf@netris.org> <87lgbpp31h.fsf@netris.org> <87a7s41bwz.fsf@elephly.net> <878t7o17i5.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000003ffe4056e3523c0" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRdWN-00037V-El for guix-devel@gnu.org; Sat, 09 Jun 2018 09:03:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRdWK-0006Tq-Gr for guix-devel@gnu.org; Sat, 09 Jun 2018 09:03:07 -0400 Received: from mail-yw0-x233.google.com ([2607:f8b0:4002:c05::233]:35274) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRdWK-0006Te-6g for guix-devel@gnu.org; Sat, 09 Jun 2018 09:03:04 -0400 Received: by mail-yw0-x233.google.com with SMTP id v131-v6so4985560ywg.2 for ; Sat, 09 Jun 2018 06:03:04 -0700 (PDT) In-Reply-To: <878t7o17i5.fsf@elephly.net> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel --00000000000003ffe4056e3523c0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ricardo, you are right that in my last interaction there was some animosity and the message was below the standard I apologize I see that you are maing an effort to deescalate. I appeciate that. Really I also see that you are suggesting some techical remediation about the store monad And that is probably the most interesting result that came out of this discussion until now After all, I just wanted to understad what this monad macro does. I'm sure you are in god faith and we are just having a misunderstanding due to the fact that we come from different bacgrounds, even if you didn't study computer science In this very moment, I'm not abe to keep interacting lucidly, though Because I lost my cool and I got tired So I can't bring myself to read your technical contribution. I probably need some time to regain my composture I will probably go to the beach to blow some steam off I'll try again starting next monday, if you don't mind So I can be more consequential, hopefully For now, just a few notes The first note is that macro expanding and macro stepping are not the same thing 2018-06-09 14:14 GMT+02:00 Ricardo Wurmus : > > Hi Catonano, > > > 2018-06-09 12:39 GMT+02:00 Ricardo Wurmus : > > > >> > >> Catonano writes: > >> > >> > Assuming that users read academic articles about programming > languages in > >> > order to know your way aroung Guile is not reasonable > >> > >> I fail to see how this follows from Guile=E2=80=99s lack of a macro st= epper. > > > > > > Then you were not following > > > > Mark indicated me a paper about the first macro stepper in history > > I did follow the discussion and I did see Mark mentioning the paper. > Since Guile does not *have* a macro stepper, reading a paper about how a > macro stepper was implemented is certainly not a requirement to use > Guile. Ok. I was following a thought of mine, I had to mae more explicit, probably In my view, hacking a quick and dirt macro stepper and then use it to explore some existing macros *IS* a requirement to use guile Because there are some macro based libraries, so using a macro stepper is a requirement for common usage As I wrote, if you provide a language feature, you need to provide the tooling for it too The fact that Guile has no macro stepper is not enough to thin that using a macro stepper is not a requirement It's enough to think that Guile is missing a fundamental bit But I understand that we can disagree on this Obviously, to implement a macro stepper it is useful to know how > to do this. But implementing a macro stepper is not what a Guile user > like myself would ever do. > Eh. It seemed to me that implementing a macro stepper was reqired to me in order to undertsand some existing macros Maybe your last techical contribution, the one that I can't read rright now, proves this false I'll try again next week and report back Thanks for clarifiyng > >> And I have > >> never felt the need to read computer science papers to =E2=80=9Cknow m= y way > >> around Guile=E2=80=9D. (I have not studied computer science, so it is= n=E2=80=99t that > >> my background allowed me to skip papers that are mandatory for other > >> users of Guile.) > >> > >> The sentence above seems like an exaggeration to me. > >> > > > > Ok, thans for your contribution > > > > > >> (I say this with no hostility, just with surprise.) > >> > > > > we have a loooong way to go > > I sense a lot of hostility in your responses to me and I don=E2=80=99t kn= ow why > that is. The first sentence reads like unwarranted sarcasm to me, > because it does not seem to relate to what I wrote; the second sounds > belittling, as if my surprise at what seems like an exaggeration to me > is evidence of how far behind I am in my efforts to ensure that Guix and > Guile a welcoming to newcomers. > > I=E2=80=99m sorry that you don=E2=80=99t find anything useful in my respo= nse above, > which relates my personal experience with Guile as someone who is not a > computer scientist. I hoped it would be a useful data point. > I' sure it is a data point I'm not sure what you think it means Does it mean that I had it coming ? You think that I indiced David Pirotte in assaulting me in that way ? > As I find discussions like this exceptionally draining and discouraging, > detrimental to my ability to volunteer time to free software, I will > take some time off from this discussion after trying to respond to your > other message to me in this thread. > > >> > The monad accessing the daemon, how would I delve in it ? > >> > >> The Guix manual should explain it fully, while assuming that the conce= pt > >> of a monad is known (because that=E2=80=99s not a Guix or Guile invent= ion). > > > > > > And how would I know what a monad is without reading academic materials= ? > > > > Maybe Haskell is a requirement in order to use Guile//Guix ? > > > > "assuming that the concept of a monad is known" is a problem. > > By analogy, do you think that assuming the concept of recursion would be > a problem? Or the concept of a closure? Would you say that this should > be explained in the *Guix* manual? (These are sincere questions.) > No. I think they should be explained in the Guile manual, though The edit I am proposing about macro stepping is for the Guile manual, not the Guix one > > We are using both of these constructs. We are also using delayed > evaluation in the form of streams. Luckily, those are provided as a > Guile library and are thus documented in the *Guile* manual. > as it shoud be > > > Someone would want to _learn_ what a monad is AND how it can be > implemented > > in scheme, by dissecting this Guix macro based feature > > I used =E2=80=9C,expand=E2=80=9D in the past to see the expansion of a ma= cro > expression. Here=E2=80=99s an example with the state monad: > ok, from here on I couldn't read as I said, I'll try again Only: macro expanding and macr stepping are not the same thing > > --8<---------------cut here---------------start------------->8--- > scheme@(guile-user)> ,expand (with-monad %state-monad (return 1)) > $3 =3D (let ((value 1)) > (lambda (state) > ((@@ (guix monads) values) value state))) > --8<---------------cut here---------------end--------------->8--- > > This shows us that returning a monadic value in the state monad is the > same as returning a procedure that takes some state and returns it > alongside the value. > > The Guix manual says about the things that we used: > > --8<---------------cut here---------------start------------->8--- > -- Scheme Syntax: with-monad MONAD BODY ... > Evaluate any =E2=80=98>>=3D=E2=80=99 or =E2=80=98return=E2=80=99 for= ms in BODY as being in MONAD. > > -- Scheme Syntax: return VAL > Return a monadic value that encapsulates VAL. > --8<---------------cut here---------------end--------------->8--- > > > Earlier, it also says something about what monads are all about: > > --8<---------------cut here---------------start------------->8--- > This is where the =E2=80=98(guix monads)=E2=80=99 module comes in. Th= is module > provides a framework for working with =E2=80=9Cmonads=E2=80=9D, and a par= ticularly > useful monad for our uses, the =E2=80=9Cstore monad=E2=80=9D. Monads are= a construct > that allows two things: associating =E2=80=9Ccontext=E2=80=9D with values= (in our case, > the context is the store), and building sequences of computations (here > computations include accesses to the store). Values in a monad=E2=80=94v= alues > that carry this additional context=E2=80=94are called =E2=80=9Cmonadic va= lues=E2=80=9D; > procedures that return such values are called =E2=80=9Cmonadic procedures= =E2=80=9D. > --8<---------------cut here---------------end--------------->8--- > > We=E2=80=99ve just seen the first part about associating =E2=80=9Ccontext= =E2=80=9D (in this case > some state) with values. The second part requires a larger expression > to see how this is useful. > > The Guix manual has an example right there: > > --8<---------------cut here---------------start------------->8--- > -- Scheme Syntax: >>=3D MVAL MPROC ... > =E2=80=9CBind=E2=80=9D monadic value MVAL, passing its =E2=80=9Ccont= ents=E2=80=9D to monadic > procedures MPROC...(1). There can be one MPROC or several of them, > as in this example: > > (run-with-state > (with-monad %state-monad > (>>=3D (return 1) > (lambda (x) (return (+ 1 x))) > (lambda (x) (return (* 2 x))))) > 'some-state) > > =E2=87=92 4 > =E2=87=92 some-state > --8<---------------cut here---------------end--------------->8--- > > So this is an expression that somewhat uselessly computes the number 4 > in a context where =E2=80=9Csome-state=E2=80=9D is present. We can use ,= expand in the > REPL to see how this works, this time with a slightly simpler > expression that would compute 1 + 1 in some given context: > > --8<---------------cut here---------------start------------->8--- > scheme@(guile-user)> ,expand (with-monad %state-monad > (>>=3D (return 1) > (lambda (x) (return (+ 1 x))))) > $6 =3D (let ((mvalue > (let ((value 1)) > (lambda (state) > ((@@ (guix monads) values) value state)))) > (mproc (lambda (x) > (let ((value (+ 1 x))) > (lambda (state) > ((@@ (guix monads) values) value state)))))) > "Bind MVALUE, a value in the state monad, and pass it to MPROC." > (lambda (state) > ((@@ (guix monads) call-with-values) > (lambda () (mvalue state)) > (lambda (value state) ((mproc value) state))))) > --8<---------------cut here---------------end--------------->8--- > > This looks similar to the previous expression (see =E2=80=9Cmvalue=E2=80= =9D). Looking > at the body, we see that this is a procedure that takes some state, > computes a new value by passing the state to =E2=80=9Cmvalue=E2=80=9D, an= d then passes > that to the next action (the last lambda in the original expression). > > I don=E2=80=99t think that the presence of the relevant documentation in = the > Guix manual and the existence of a macro-expansion facility should be > taken as evidence that we =E2=80=9Cthink that the code should be kept obs= cure > and unaccessible=E2=80=9D. > > I would also like to state, though, that the use of the state monad is > hardly essential for the purpose of extending or contributing to Guix. > If you find a way to improve the existing documentation, you know from > our past interactions that the maintainers and developers are very > welcoming of additions or changes to the manual. > > -- > Ricardo > > --00000000000003ffe4056e3523c0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ricardo,

you are right that in my last interaction there was= some animosity and the message was below the standard

I apolo= gize

I see that you are maing an effort to deescalate. I appec= iate that. Really

I also see that you are suggesting some tech= ical remediation about the store monad

And that is probab= ly the most interesting result that came out of this discussion until now
After all, I just wanted to understad what this monad macr= o does.

I'm sure you are in god faith and we are just= having a misunderstanding due to the fact that we come from different bacg= rounds, even if you didn't study computer science

In this very moment, I'm not abe to keep interacting lucidly, though=

Because I lost my cool and I got tired

So I can&= #39;t bring myself to read your technical contribution.

I prob= ably need some time to regain my composture

I will probably go= to the=C2=A0 beach to blow some steam off

I'll try again = starting next monday, if you don't mind

So I can be more c= onsequential, hopefully

For now, just a few notes

The f= irst note is that macro expanding and macro stepping are not the same thing=


2018-06= -09 14:14 GMT+02:00 Ricardo Wurmus <rekado@elephly.net>:

Hi Catonano,

> 2018-06-09 12:39 GMT+02:00 Ricardo Wurmus <rekado@elephly.net>:
>
>>
>> Catonano <catonano@gmail.= com> writes:
>>
>> > Assuming that users read academic articles about programming = languages in
>> > order to know your way aroung Guile is not reasonable
>>
>> I fail to see how this follows from Guile=E2=80=99s lack of a macr= o stepper.
>
>
> Then you were not following
>
> Mark indicated me a paper about the first macro stepper in history

I did follow the discussion and I did see Mark mentioning the paper.=
Since Guile does not *have* a macro stepper, reading a paper about how a macro stepper was implemented is certainly not a requirement to use
Guile.=C2=A0

Ok. I was following a thought= of mine, I had to mae more explicit, probably

In my view= , hacking a quick and dirt macro stepper and then use it to explore some ex= isting macros *IS* a requirement to use guile

Because the= re are some macro based libraries, so using a macro stepper is a requiremen= t for common usage

As I wrote, if you provide a language = feature, you need to provide the tooling for it too

The f= act that Guile has no macro stepper is not enough to thin that using a macr= o stepper is not a requirement
It's enough to think that = Guile is missing a fundamental bit
=C2=A0
But I= understand that we can disagree on this

Obviously, to implement a macro stepper it is useful to know how<= br> to do this.=C2=A0 But implementing a macro stepper is not what a Guile user=
like myself would ever do.

Eh.
It seemed to me that implementing a macro stepper was reqired to me = in order to undertsand some existing macros

Maybe your la= st techical contribution, the one that I can't read rright now,=C2=A0 p= roves this false
=C2=A0
I'll try again next= week and report back

Thanks for clarifiyng

=

>> And I have
>> never felt the need to read computer science papers to =E2=80=9Ckn= ow my way
>> around Guile=E2=80=9D.=C2=A0 (I have not studied computer science,= so it isn=E2=80=99t that
>> my background allowed me to skip papers that are mandatory for oth= er
>> users of Guile.)
>>
>> The sentence above seems like an exaggeration to me.
>>
>
> Ok, thans for your contribution
>
>
>> (I say this with no hostility, just with surprise.)
>>
>
> we have a loooong way to go

I sense a lot of hostility in your responses to me and I don=E2=80= =99t know why
that is.=C2=A0 The first sentence reads like unwarranted sarcasm to me,
because it does not seem to relate to what I wrote; the second sounds
belittling, as if my surprise at what seems like an exaggeration to me
is evidence of how far behind I am in my efforts to ensure that Guix and Guile a welcoming to newcomers.

I=E2=80=99m sorry that you don=E2=80=99t find anything useful in my respons= e above,
which relates my personal experience with Guile as someone who is not a
computer scientist.=C2=A0 I hoped it would be a useful data point.

I' sure it is a data point

I'm not sure what you think it means

Does it mean t= hat I had it coming ?

You think that I indiced David Pir= otte in assaulting me in that way ?

=C2=A0
As I find discussions like this exceptionally draining and discouraging, detrimental to my ability to volunteer time to free software, I will
take some time off from this discussion after trying to respond to your
other message to me in this thread.

>> > The monad accessing the daemon, how would I delve in it ?
>>
>> The Guix manual should explain it fully, while assuming that the c= oncept
>> of a monad is known (because that=E2=80=99s not a Guix or Guile in= vention).
>
>
> And how would I know what a monad is without reading academic material= s ?
>
> Maybe Haskell is a requirement in order to use Guile//Guix ?
>
> "assuming that the concept of a monad is known" is a problem= .

By analogy, do you think that assuming the concept of recursion woul= d be
a problem?=C2=A0 Or the concept of a closure?=C2=A0 Would you say that this= should
be explained in the *Guix* manual?=C2=A0 (These are sincere questions.)
=

No.
I think they should be explained i= n the Guile manual, though

The edit I am proposing about = macro stepping is for the Guile manual, not the Guix one
=C2= =A0

We are using both of these constructs.=C2=A0 We are also using delayed
evaluation in the form of streams.=C2=A0 Luckily, those are provided as a Guile library and are thus documented in the *Guile* manual.

as it shoud be
=C2=A0

> Someone would want to _learn_ what a monad is AND how it can be implem= ented
> in scheme, by dissecting this Guix macro based feature

I used =E2=80=9C,expand=E2=80=9D in the past to see the expansion of= a macro
expression.=C2=A0 Here=E2=80=99s an example with the state monad:

ok, from here on I couldn't read

as I said, I'll try again

Only: macro expandin= g and macr stepping are not the same thing
=C2=A0

--8<---------------cut here---------------start------------->8--= -
scheme@(guile-user)> ,expand (with-monad %state-monad (return 1))
$3 =3D (let ((value 1))
=C2=A0 (lambda (state)
=C2=A0 =C2=A0 ((@@ (guix monads) values) value state)))
--8<---------------cut here---------------end--------------->8--= -

This shows us that returning a monadic value in the state monad is the
same as returning a procedure that takes some state and returns it
alongside the value.

The Guix manual says about the things that we used:

--8<---------------cut here---------------start------------->8--= -
=C2=A0-- Scheme Syntax: with-monad MONAD BODY ...
=C2=A0 =C2=A0 =C2=A0Evaluate any =E2=80=98>>=3D=E2=80=99 or =E2=80=98= return=E2=80=99 forms in BODY as being in MONAD.

=C2=A0-- Scheme Syntax: return VAL
=C2=A0 =C2=A0 =C2=A0Return a monadic value that encapsulates VAL.
--8<---------------cut here---------------end--------------->8--= -


Earlier, it also says something about what monads are all about:

--8<---------------cut here---------------start------------->8--= -
=C2=A0 =C2=A0This is where the =E2=80=98(guix monads)=E2=80=99 module comes= in.=C2=A0 This module
provides a framework for working with =E2=80=9Cmonads=E2=80=9D, and a parti= cularly
useful monad for our uses, the =E2=80=9Cstore monad=E2=80=9D.=C2=A0 Monads = are a construct
that allows two things: associating =E2=80=9Ccontext=E2=80=9D with values (= in our case,
the context is the store), and building sequences of computations (here
computations include accesses to the store).=C2=A0 Values in a monad=E2=80= =94values
that carry this additional context=E2=80=94are called =E2=80=9Cmonadic valu= es=E2=80=9D;
procedures that return such values are called =E2=80=9Cmonadic procedures= =E2=80=9D.
--8<---------------cut here---------------end--------------->8--= -

We=E2=80=99ve just seen the first part about associating =E2=80=9Ccontext= =E2=80=9D (in this case
some state) with values.=C2=A0 The second part requires a larger expression=
to see how this is useful.

The Guix manual has an example right there:

--8<---------------cut here---------------start------------->8--= -
=C2=A0-- Scheme Syntax: >>=3D MVAL MPROC ...
=C2=A0 =C2=A0 =C2=A0=E2=80=9CBind=E2=80=9D monadic value MVAL, passing its = =E2=80=9Ccontents=E2=80=9D to monadic
=C2=A0 =C2=A0 =C2=A0procedures MPROC...(1).=C2=A0 There can be one MPROC or= several of them,
=C2=A0 =C2=A0 =C2=A0as in this example:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (run-with-state
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (with-monad %state-monad =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (>>=3D (retur= n 1)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(lambda (x) (return (+ 1 x)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(lambda (x) (return (* 2 x)))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'some-state)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=87=92 4
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=87=92 some-state
--8<---------------cut here---------------end--------------->8--= -

So this is an expression that somewhat uselessly computes the number 4
in a context where =E2=80=9Csome-state=E2=80=9D is present.=C2=A0 We can us= e ,expand in the
REPL to see how this works, this time with a slightly simpler
expression that would compute 1 + 1 in some given context:

--8<---------------cut here---------------start------------->8--= -
scheme@(guile-user)> ,expand (with-monad %state-monad
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(>>=3D (return 1)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (x) (return (+= 1 x)))))
$6 =3D (let ((mvalue
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((value 1))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (state)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((@@ (guix monads) values) value = state))))
=C2=A0 =C2=A0 =C2=A0 (mproc (lambda (x)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((value (+ 1 x)= ))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda (stat= e)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((@@ (= guix monads) values) value state))))))
=C2=A0 "Bind MVALUE, a value in the state monad, and pass it to MPROC.= "
=C2=A0 (lambda (state)
=C2=A0 =C2=A0 ((@@ (guix monads) call-with-values)
=C2=A0 =C2=A0 =C2=A0(lambda () (mvalue state))
=C2=A0 =C2=A0 =C2=A0(lambda (value state) ((mproc value) state)))))
--8<---------------cut here---------------end--------------->8--= -

This looks similar to the previous expression (see =E2=80=9Cmvalue=E2=80=9D= ).=C2=A0 Looking
at the body, we see that this is a procedure that takes some state,
computes a new value by passing the state to =E2=80=9Cmvalue=E2=80=9D, and = then passes
that to the next action (the last lambda in the original expression).

I don=E2=80=99t think that the presence of the relevant documentation in th= e
Guix manual and the existence of a macro-expansion facility should be
taken as evidence that we =E2=80=9Cthink that the code should be kept obscu= re
and unaccessible=E2=80=9D.

I would also like to state, though, that the use of the state monad is
hardly essential for the purpose of extending or contributing to Guix.
If you find a way to improve the existing documentation, you know from
our past interactions that the maintainers and developers are very
welcoming of additions or changes to the manual.

--
Ricardo


--00000000000003ffe4056e3523c0--