Nix Documentation | 398 Members | |
| Discussion about documentation improvements around the Nix ecosystem | 81 Servers |
| Sender | Message | Time |
|---|---|---|
| 29 Apr 2024 | ||
| 15:29:10 | ||
| 30 Apr 2024 | ||
| Also known as “
| 12:26:51 | |
| I see the word assignment is used apr in the nix tutorial on nix dev | 12:27:06 | |
| * I see the word assignment is used a lot in the nix tutorial on nix dev | 12:27:18 | |
| * I see the word assignment is used alot in the nix tutorial on nix dev | 12:27:38 | |
| Im curious why not bind or binding | 12:27:53 | |
| Most people are probably more familiar with the concept of variable assignment. | 12:28:22 | |
| I see Eelco uses the word assignment twice in thesis and binding more than 60 times. | 12:29:24 | |
| Oh ok how do you say usually? | 12:29:47 | |
| I'd probably say assign more often. One difference is you assign a value to a variable, while you bind an identifier to a value. | 12:32:45 | |
| Oh like the assigned value changes while the identifier binds to that value | 12:34:52 | |
| Well, in a pure language values assigned to variables don't actually change. | 12:36:43 | |
| You can shadow a name but that's not really the value changing. | 12:36:59 | |
| Yes thats where my question is coming from. | 12:41:43 | |
| x = 2 x is 3let x = 5; in x x stays 3 | 12:42:20 | |
| Uh formatting.. sorry. So assingment is said as convention in nix? | 12:42:49 | |
| I wouldn't say it's a Nix convention per se. More of a general programmer's convention. | 12:44:21 | |
| I also wouldn't worry about it much but maybe that's just me. | 12:46:45 | |
| Yeah I was curious because its used in the nix tutorial. | 13:01:18 | |
* | 13:02:23 | |
| * x = 2 x = 3 x is 3let x = 5; in x 5 x stays 3 | 13:08:54 | |
* | 13:09:35 | |
In reply to @toonn:matrix.orgOh I see now, its like describing two directions. The assignment is describing direction from value to variable and the binding from identifier to value? | 13:18:42 | |
| Yes. Though I'm not saying that is the only difference. | 13:32:52 | |
| 14:18:04 | ||
In reply to @toonn:matrix.orgThats very interesting | 15:30:20 | |
In reply to @stablejoy:matrix.org 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 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. 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 | |
| * 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 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. 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 | |
| Correct 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 please | 17:31:51 | |
| * 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 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. 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 | |