| 2 Aug 2022 |
Alyssa Ross | But execline does ;) | 14:04:33 |
profpatsch | I guess scheme doesn’t have to compose either, but it’s easier to get right because you have proper scoping etc | 14:04:35 |
profpatsch | qyliss: agreed | 14:04:43 |
profpatsch | qyliss: In my experience execline is only good for simple tasks though, I wouldn’t want to convert the stdenv to plain execline, even generated execline. | 14:05:18 |
Alyssa Ross | My point is that you can use Nix as a DSL to generate whatever you want, no homoiconicity required. | 14:05:19 |
infinisil | I'd argue that then it's not using the same language anymore | 14:05:21 |
infinisil | Yeah it's a Nix DSL at that point, not Nix | 14:05:29 |
Alyssa Ross | Then you're missing the point by interpreting things too narrowly. | 14:05:44 |
profpatsch | infinisil: guix in the builder is different from guix at eval time | 14:05:57 |
profpatsch | The semantics are the important part, not the syntax | 14:06:03 |
infinisil | It is different? | 14:06:20 |
profpatsch | The cool thing is that you can re-use the semantics of stuff like “case” or “if”, but e.g. (read-file) has a totally different semantics if you use it at eval time | 14:06:40 |
profpatsch | i.e. one would presumably read a file and copy it to the store returning a store path, the other would just read a file into the interpreter at build time | 14:07:49 |
profpatsch | (just a dumb example) | 14:08:01 |
infinisil | Alright, so how about this: If we want to use the same syntax for eval and build time, we need homoiconicity. But for the same semantics (with a different syntax) we don't need homoiconicity | 14:08:21 |
infinisil | Does that sound right Alyssa Ross ? | 14:08:29 |
profpatsch | but if <bool> then <exp> else <exp> would behave the same in both settings | 14:08:35 |
profpatsch | infinisil: yep, exactly | 14:08:56 |
Alyssa Ross | No? | 14:08:58 |
Alyssa Ross | the syntax is nix syntax | 14:09:12 |
Alyssa Ross | but i think these semantics are entirely unimportant | 14:09:36 |
profpatsch | I guess the problem is that it’s just not a very well defined term in the first place | 14:09:37 |
infinisil | Anyways, it doesn't really matter, we can't switch to lisp, and we can't use Nix's if at build time unless a DSL is used | 14:10:52 |
infinisil | * Anyways, it doesn't really matter, we can't switch to lisp, and we can't use Nix's if (and other syntax) at build time unless a DSL is used | 14:11:06 |
infinisil | Or Nix gets extended with this capability | 14:11:40 |
profpatsch | I’d compare it to e.g. opaleye, which is a Haskell DSL which has some nice static composition properties, and at the end it generates postgres SQL | 14:11:59 |
profpatsch | if you want people to have “the nix everywhere” experience, you’d need something like that | 14:12:19 |
profpatsch | Whether it generates bash, execline, or lisp at the end doesn’t really matter | 14:12:29 |
profpatsch | … Unless you want to debug it of course :) | 14:12:41 |
infinisil | I think we don't want that | 14:13:43 |