Re: [Nix-dev] Anyone care to review my post on the Nix expression language?

2014-10-10 Thread James Harrison Fisher
Hey Colin,

Thanks for the praise. I concentrated a lot on laziness because I think it’s 
really critical to understanding how Nix works and is probably unfamiliar to 
everyone outside Haskell land.

You might be right about the "white lies” approach. It’s a tricky balance to 
get right — at one end an unfriendly formal specification; at the other, reader 
mistrust. :) I’ll try to tone it down.

Thanks very much,

James

On 8 Oct 2014, at 17:50, Colin Putney  wrote:

> 
> 
> On Wed, Oct 8, 2014 at 5:00 AM, James Harrison Fisher 
>  wrote:
> Thanks Ellis! If there’s anything you didn’t enjoy, I’d love to know, since 
> I’ll be writing more of these and I want to establish a style that people 
> like. :-)
> 
> Awesome article.  I especially liked the gory detail on how expression trees 
> are evaluated. I've been writing nix expressions for a few months and already 
> knew most of the material you covered, but that section really made it clear 
> how and why lazy evaluation works the way it does. 
> 
> The only thing I didn't enjoy was the "I lied" motif. Especially after the 
> lazy-lists thing, it made me wonder if I could believe what I was a reading. 
> The general technique of over-simplifying and then introducing layers of 
> nuance is good, but I think you over-did it. 
> 
> I'm really looking forward to the next article!
> 
> -Colin

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Anyone care to review my post on the Nix expression language?

2014-10-10 Thread James Harrison Fisher
Hey Wout,

I’m glad :)

And you’ve taught me, too: I’ll correct my statement about the division 
operator and credit you.

And yeah, good catch on the TODO! Thanks!

James
On 8 Oct 2014, at 17:50, Wout Mertens  wrote:

> Hi James,
> 
> great reading, I learned a few things! (like that let is a recursive 
> definition, doh :) )
> 
> Nix does support the / operator, but it needs spaces or it will be recognized 
> as a path:
>  $ nix-instantiate --eval --expr '4/3'
> /Users/wmertens/4/3
>  $ nix-instantiate --eval --expr '6 / 3'
> 2
> 
> https://github.com/NixOS/nix/blob/b6809608cc467925db44b1eb435095c37e433255/src/libexpr/parser.y#L347
> 
> Wout.
> 
> PS: (You know that the default-values example is still marked TODO, right?)
> 
> 
> 
> On Wed, Oct 8, 2014 at 11:31 AM, Ellis Whitehead  
> wrote:
> Hi James.  For what it's worth: I haven't finished it yet, but I've
> enjoyed the reading so far.
> 
> On Wed, Oct 8, 2014 at 12:21 AM, James Harrison Fisher
>  wrote:
> > Hi all,
> >
> > I’ve written up what turned out to be a quite extensive post on the Nix 
> > expression language:
> >
> > https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55
> >
> > I was hoping that someone with more knowledge than me could read it and 
> > comment on inaccuracies. I’m sure there will be some, since I’m learning 
> > while writing.
> >
> > Any and all comments appreciated!
> >
> > Best,
> >
> > James
> > ___
> > nix-dev mailing list
> > nix-dev@lists.science.uu.nl
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Anyone care to review my post on the Nix expression language?

2014-10-08 Thread Wout Mertens
Hi James,

great reading, I learned a few things! (like that let is a recursive
definition, doh :) )

Nix does support the / operator, but it needs spaces or it will be
recognized as a path:
 $ nix-instantiate --eval --expr '4/3'
/Users/wmertens/4/3
 $ nix-instantiate --eval --expr '6 / 3'
2

https://github.com/NixOS/nix/blob/b6809608cc467925db44b1eb435095c37e433255/src/libexpr/parser.y#L347

Wout.

PS: (You know that the default-values example is still marked TODO, right?)



On Wed, Oct 8, 2014 at 11:31 AM, Ellis Whitehead 
wrote:

> Hi James.  For what it's worth: I haven't finished it yet, but I've
> enjoyed the reading so far.
>
> On Wed, Oct 8, 2014 at 12:21 AM, James Harrison Fisher
>  wrote:
> > Hi all,
> >
> > I’ve written up what turned out to be a quite extensive post on the Nix
> expression language:
> >
> > https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55
> >
> > I was hoping that someone with more knowledge than me could read it and
> comment on inaccuracies. I’m sure there will be some, since I’m learning
> while writing.
> >
> > Any and all comments appreciated!
> >
> > Best,
> >
> > James
> > ___
> > nix-dev mailing list
> > nix-dev@lists.science.uu.nl
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Anyone care to review my post on the Nix expression language?

2014-10-08 Thread Colin Putney
On Wed, Oct 8, 2014 at 5:00 AM, James Harrison Fisher <
jameshfis...@gmail.com> wrote:

> Thanks Ellis! If there’s anything you didn’t enjoy, I’d love to know,
> since I’ll be writing more of these and I want to establish a style that
> people like. :-)


Awesome article.  I especially liked the gory detail on how expression
trees are evaluated. I've been writing nix expressions for a few months and
already knew most of the material you covered, but that section really made
it clear how and why lazy evaluation works the way it does.

The only thing I didn't enjoy was the "I lied" motif. Especially after the
lazy-lists thing, it made me wonder if I could believe what I was a
reading. The general technique of over-simplifying and then introducing
layers of nuance is good, but I think you over-did it.

I'm really looking forward to the next article!

-Colin
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Anyone care to review my post on the Nix expression language?

2014-10-08 Thread James Harrison Fisher
Thanks Ellis! If there’s anything you didn’t enjoy, I’d love to know, since 
I’ll be writing more of these and I want to establish a style that people like. 
:-)

On 8 Oct 2014, at 10:31, Ellis Whitehead  wrote:

> Hi James.  For what it's worth: I haven't finished it yet, but I've
> enjoyed the reading so far.
> 
> On Wed, Oct 8, 2014 at 12:21 AM, James Harrison Fisher
>  wrote:
>> Hi all,
>> 
>> I’ve written up what turned out to be a quite extensive post on the Nix 
>> expression language:
>> 
>>https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55
>> 
>> I was hoping that someone with more knowledge than me could read it and 
>> comment on inaccuracies. I’m sure there will be some, since I’m learning 
>> while writing.
>> 
>> Any and all comments appreciated!
>> 
>> Best,
>> 
>> James
>> ___
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Anyone care to review my post on the Nix expression language?

2014-10-08 Thread Ellis Whitehead
Hi James.  For what it's worth: I haven't finished it yet, but I've
enjoyed the reading so far.

On Wed, Oct 8, 2014 at 12:21 AM, James Harrison Fisher
 wrote:
> Hi all,
>
> I’ve written up what turned out to be a quite extensive post on the Nix 
> expression language:
>
> https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55
>
> I was hoping that someone with more knowledge than me could read it and 
> comment on inaccuracies. I’m sure there will be some, since I’m learning 
> while writing.
>
> Any and all comments appreciated!
>
> Best,
>
> James
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Anyone care to review my post on the Nix expression language?

2014-10-08 Thread James Harrison Fisher
Thanks for looking Luca! And a good point; Debug.trace is a better analogy.

On 7 Oct 2014, at 23:33, Luca Bruno  wrote:

> Length and nice, thanks. Only had a quick look. Note that haskell has 
> Debug.trace.
> 
> On Wed, Oct 8, 2014 at 12:21 AM, James Harrison Fisher 
>  wrote:
> Hi all,
> 
> I’ve written up what turned out to be a quite extensive post on the Nix 
> expression language:
> 
> https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55
> 
> I was hoping that someone with more knowledge than me could read it and 
> comment on inaccuracies. I’m sure there will be some, since I’m learning 
> while writing.
> 
> Any and all comments appreciated!
> 
> Best,
> 
> James
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 
> 
> 
> -- 
> www.debian.org - The Universal Operating System

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Anyone care to review my post on the Nix expression language?

2014-10-07 Thread Luca Bruno
Length and nice, thanks. Only had a quick look. Note that haskell has
Debug.trace.

On Wed, Oct 8, 2014 at 12:21 AM, James Harrison Fisher <
jameshfis...@gmail.com> wrote:

> Hi all,
>
> I’ve written up what turned out to be a quite extensive post on the Nix
> expression language:
>
> https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55
>
> I was hoping that someone with more knowledge than me could read it and
> comment on inaccuracies. I’m sure there will be some, since I’m learning
> while writing.
>
> Any and all comments appreciated!
>
> Best,
>
> James
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>



-- 
www.debian.org - The Universal Operating System
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] Anyone care to review my post on the Nix expression language?

2014-10-07 Thread James Harrison Fisher
Hi all,

I’ve written up what turned out to be a quite extensive post on the Nix 
expression language:

https://medium.com/@MrJamesFisher/nix-by-example-a0063a1a4c55

I was hoping that someone with more knowledge than me could read it and comment 
on inaccuracies. I’m sure there will be some, since I’m learning while writing.

Any and all comments appreciated!

Best,

James
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev