!avYyleMexqjFHoqrME:nixos.org

Nix Documentation

380 Members
This is the official channel for documentation in the Nix ecosystem. The documentation team meets here. More information: https://nixos.org/community/teams/documentation Video conference: https://jitsi.lassul.us/nix-documentation Meeting notes scratch pad: https://pad.lassul.us/p-Y8MjU2SdSD5qO1fnpCPA Past meeting notes: https://discourse.nixos.org/search?q=documentation%20team%20meeting%20order%3Alatest 72 Servers

Load older messages


SenderMessageTime
30 Apr 2024
@stablejoy:matrix.org@stablejoy:matrix.org
In reply to @toonn:matrix.org
Yes. Though I'm not saying that is the only difference.
Thats very interesting
15:30:20
@nasrally:matrix.orgnasrally
In reply to @stablejoy:matrix.org
Oh I see now, its like describing two directions. The assignment is describing direction from value to variable and the binding from identifier to value?

Also, sorry it's long, but in terms of basic lambda calculus thingies you don't get to have named functions or values at all, all you have is 1) functions that accept values (1 value to be precise) and that value being applied into the body of that function (that is the input value is substituted for the name inside the body as-is and the "head" of the function is plucked off, e.g. in λx.x λx is the head and . is a separator and x is the body and if you get something inside, you put it in λ__x__, it is piped through . and the inner x is replaced with the value you put inside the head, then head is removed and you are left with is the body!, also body can be xxx that would mean the input value is duplicated into three, so functions control WHERE you place something which directly affects in what order things are evaluated (applied to each other) later on which is key) 2) a rule is at the moment of evaluation (application) no free variable can be used for substitution, that is if you take something that does not represent anything concrete (has no actual value in its place) that value cannot be applied further into the body.

So because all you do is apply something from the head into the body, basically you view programs in pure languages as humongous onion functions that take some input and propagate it somewhere deeper modifying it in only god knows what ways, as the program evaluates, with every outer level of that huge onion removed, some inner layers gets a variable bound further and further until in the end you're left with some final value where everything that can be applied was applied.
In reality you're greatly abstracted away from the crazy logic of OG lambda calculus (and to some extent limited by practical computer design) with types like numbers strings and (I think) some operations on those types (you get typed lambda calculus), but the basic principles don't change.

What you see with named values (value being anything from a number to a function) is simply a programmer abstraction, you assign names to your values for pure convenience because in the end any such program can be rewritten without any names with only values as a bunch of functions and values nested inside each other, that is unlike the imperarive mindset where variables are used as storage spaces and not simply as names for values to be substituted

So again, yes, you bind names to values so that you can effectively as a programmer use those values in a short and concise way, not to actually store anything in them

17:31:19
@nasrally:matrix.orgnasrally *

Also, sorry it's long, but in terms of basic lambda calculus thingies you don't get to have named functions or values at all, all you have is 1) functions that accept values (1 value to be precise) and that value being applied into the body of that function (that is the input value is substituted for the name inside the body as-is and the "head" of the function is plucked off, e.g. in λx.x λx is the head and . is a separator and x is the body and if you get something inside, you put it in λx, it is piped through . and the inner x is replaced with the value you put inside the head, then head is removed and you are left with is the body!, also body can be xxx that would mean the input value is duplicated into three, so functions control WHERE you place something which directly affects in what order things are evaluated (applied to each other) later on which is key) 2) a rule is at the moment of evaluation (application) no free variable can be used for substitution, that is if you take something that does not represent anything concrete (has no actual value in its place) that value cannot be applied further into the body.

So because all you do is apply something from the head into the body, basically you view programs in pure languages as humongous onion functions that take some input and propagate it somewhere deeper modifying it in only god knows what ways, as the program evaluates, with every outer level of that huge onion removed, some inner layers gets a variable bound further and further until in the end you're left with some final value where everything that can be applied was applied.
In reality you're greatly abstracted away from the crazy logic of OG lambda calculus (and to some extent limited by practical computer design) with types like numbers strings and (I think) some operations on those types (you get typed lambda calculus), but the basic principles don't change.

What you see with named values (value being anything from a number to a function) is simply a programmer abstraction, you assign names to your values for pure convenience because in the end any such program can be rewritten without any names with only values as a bunch of functions and values nested inside each other, that is unlike the imperarive mindset where variables are used as storage spaces and not simply as names for values to be substituted

So again, yes, you bind names to values so that you can effectively as a programmer use those values in a short and concise way, not to actually store anything in them

17:31:34
@nasrally:matrix.orgnasrallyCorrect me if I'm wrong, my understanding is rather superfluous unlike some here, so just please make sure I didn't put out any misinformation please17:31:51
@nasrally:matrix.orgnasrally *

Also, sorry it's long, but in terms of basic lambda calculus thingies you don't get to have named functions or values at all, all you have is 1) functions that accept values (1 value to be precise) and that value being applied into the body of that function (that is the input value is substituted for the name inside the body as-is and the "head" of the function is plucked off, e.g. in λx.x λx is the head and . is a separator and x is the body and if you get something inside, you put it in λx, it is piped through . and the inner x is replaced with the value you put inside the head, then head is removed and you are left with is the body!, also body can be xxx that would mean the input value is duplicated into three etc any combinations, so functions control WHERE you place something which directly affects in what order things are evaluated (applied to each other) later on which is key) 2) a rule is at the moment of evaluation (application) no free variable can be used for substitution, that is if you take something that does not represent anything concrete (has no actual value in its place) that value cannot be applied further into the body.

So because all you do is apply something from the head into the body, basically you view programs in pure languages as humongous onion functions that take some input and propagate it somewhere deeper modifying it in only god knows what ways, as the program evaluates, with every outer level of that huge onion removed, some inner layers gets a variable bound further and further until in the end you're left with some final value where everything that can be applied was applied.
In reality you're greatly abstracted away from the crazy logic of OG lambda calculus (and to some extent limited by practical computer design) with types like numbers strings and (I think) some operations on those types (you get typed lambda calculus), but the basic principles don't change.

What you see with named values (value being anything from a number to a function) is simply a programmer abstraction, you assign names to your values for pure convenience because in the end any such program can be rewritten without any names with only values as a bunch of functions and values nested inside each other, that is unlike the imperarive mindset where variables are used as storage spaces and not simply as names for values to be substituted

So again, yes, you bind names to values so that you can effectively as a programmer use those values in a short and concise way, not to actually store anything in them

17:32:58
@nasrally:matrix.orgnasrallyAlso by they way that whole purity thing pricatically makes functional programs so easy to navigate in code, if you have something in some function it means it was propagated there through its arguments, and you can just find the called, and the further caller etc, no nothing gets inside from some global space that is sooo convenient, functional style is sooooo convenient17:39:37
@nasrally:matrix.orgnasrally* Also by they way that whole purity thing pricatically makes functional programs so easy to navigate in code, if you have something in some function it means it was propagated there through its arguments, and you can just find the caller, and the further caller etc, no nothing gets inside from some global space that is sooo convenient, functional style is sooooo convenient17:39:57
@xondtx:matrix.orgondt joined the room.22:05:55
1 May 2024
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.15:06:26
2 May 2024
@nick_kadutskyi:matrix.org@nick_kadutskyi:matrix.org joined the room.17:16:19
@hbjy:matrix.orgHayden joined the room.20:42:00
@nick_kadutskyi:matrix.org@nick_kadutskyi:matrix.org set a profile picture.21:19:12
3 May 2024
@stablejoy:matrix.org@stablejoy:matrix.orgI have a question about possible reordering of sections? I'm doing the nix language tutorial and its about this: After the https://nix.dev/tutorials/nix-language#attribute-set-argument comes the default value part section, followed by the additional attributes part. Why is default value part between? Perhaps the additional attributes part would make more sense right after the attribute set argument because it effectively addresses the counterexample by introducing the ellipsis? As stated in the additional attributes part: Unlike in the previous counter-example, passing an argument that contains additional attributes is not an error.08:55:30
@fricklerhandwerk:matrix.orgfricklerhandwerk
In reply to @stablejoy:matrix.org
I have a question about possible reordering of sections? I'm doing the nix language tutorial and its about this: After the https://nix.dev/tutorials/nix-language#attribute-set-argument comes the default value part section, followed by the additional attributes part. Why is default value part between? Perhaps the additional attributes part would make more sense right after the attribute set argument because it effectively addresses the counterexample by introducing the ellipsis? As stated in the additional attributes part: Unlike in the previous counter-example, passing an argument that contains additional attributes is not an error.
Sure, doesn’t sound wrong. I don’t have a strong preference here, feel free to make a suggestion that reads somewhat fluently. :)
09:06:39
@fricklerhandwerk:matrix.orgfricklerhandwerk
In reply to @stablejoy:matrix.org
Oh I see now, its like describing two directions. The assignment is describing direction from value to variable and the binding from identifier to value?
That’s helpful insight. I chose “assign” because it’s not just programmer jargon but also makes sense in everyday life. You “assign someone to a task”, things like that. You wouldn’t “bind a task to someone”.
09:11:41
@stablejoy:matrix.org@stablejoy:matrix.org
In reply to @fricklerhandwerk:matrix.org
That’s helpful insight. I chose “assign” because it’s not just programmer jargon but also makes sense in everyday life. You “assign someone to a task”, things like that. You wouldn’t “bind a task to someone”.
Oh. I guess you could assign a task to someone who is bound by oath to you
10:21:07
@toonn:matrix.orgtoonn I think the point is more that "to assign" is more commonly understood than "to bind." 10:36:08
@kiike:matrix.orgEnric Morales joined the room.15:51:13
@stablejoy:matrix.org@stablejoy:matrix.org
In reply to @toonn:matrix.org
I think the point is more that "to assign" is more commonly understood than "to bind."
Can one say then you assign a value to a variable and you bind an expression to a variable. The second is said in nix repl help. Also binding functions vs assigning values?
16:05:27
@toonn:matrix.orgtoonn You bind to identifiers rather than values. 16:52:22
@toonn:matrix.orgtoonn In most languages functions aren't first-class values so a different term is useful to distinguish what you do with them. 16:52:54
@toonn:matrix.orgtoonn But in Nix functions are just values. 16:53:02
@qyriad:katesiria.orgQyriad
In reply to@toonn:matrix.org
I think the point is more that "to assign" is more commonly understood than "to bind."
Worth noting that Rust uses bind for their let construct, instead of assign, which seems to get by fine
16:58:39
@toonn:matrix.orgtoonn Sure, the reasoning is probably that Nix is more likely to be touched by non-programmers. 17:11:11
@stablejoy:matrix.org@stablejoy:matrix.org I made a yt channel and am making recordings while going through all nix dev tutorials. 17:46:58
@stablejoy:matrix.org@stablejoy:matrix.orghttps://youtu.be/YdrS3at-O9k?si=AttmjkwlTAFhAcBG17:47:35
4 May 2024
@pennae:matrix.eno.space@pennae:matrix.eno.space left the room.20:59:32
6 May 2024
@stablejoy:matrix.org@stablejoy:matrix.orghttps://github.com/NixOS/nix.dev/pull/97406:33:20
@stablejoy:matrix.org@stablejoy:matrix.org the issue remains in the icat.nix 06:34:00
@stablejoy:matrix.org@stablejoy:matrix.org is the lib supposed to stay throughout the tutorial? 06:34:28

Show newer messages


Back to Room ListRoom Version: 6