| 2 Aug 2022 |
infinisil | I don't think that relates to macros | 14:02:09 |
profpatsch | My ideal stdenv would be written in R[6]RS scheme, with a potential layer of nix-that-gets-converted-to-sexps on top for end-users | 14:02:36 |
infinisil | Alyssa Ross: If we wanted to have something like guix, only needing a single language for eval and build, then we need homoiconicity, or something like it, I'm pretty sure | 14:02:52 |
profpatsch | (which gives you macros (i.e. codegen) by defition, just in a different way) | 14:02:55 |
infinisil | I don't think we do want that | 14:02:56 |
infinisil | But it's the conclusion I'm trying to convey | 14:03:04 |
Alyssa Ross | No we wouldn't | 14:03:42 |
profpatsch | The argumentation is a bit similar to the “I want dependent types because I can use my if on the typelevel” approach | 14:03:46 |
Alyssa Ross | You could build up a shell script from Nix functions if you wanted | 14:03:56 |
profpatsch | (for Guix) | 14:03:59 |
profpatsch | qyliss: yeah, the big difference is that shell scripts don’t compose | 14:04:16 |
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 |