| 2 Aug 2022 |
infinisil | homoiconicity is the keyword | 13:55:14 |
profpatsch | kevincox: Not to be too offtopic, but in fish I just have an alias like with foobar which puts foobar on PATH https://gist.github.com/Profpatsch/037e4f527e37ecfcf0b6e365b78b917d | 13:56:43 |
profpatsch | And for using my own shell for nix-shell environments, direnv works like a charm | 13:56:58 |
infinisil | Hmm, so as far as I can see, if we want something as nice as Guix, only needing a single language for both evaluation and building, we need a "homoiconic" language. The only somewhat popular class of languages that are homoiconic is lisps though, which I don't think is viable because it's lisp | 13:58:34 |
profpatsch | infinisil: fwiw the homowhatever stuff is just a fancy way of saying “macros”, and in my experience macros make code really hard to read & understand | 13:58:56 |
infinisil | Also it would require switching away from bash and Nix | 13:59:04 |
profpatsch | as opposed to plain old functions | 13:59:08 |
profpatsch | infinisil: homoiconic just means that the syntax is the AST | 13:59:31 |
infinisil | profpatsch: I don't think that's what matters | 13:59:38 |
profpatsch | which is only useful if you want macros | 13:59:43 |
profpatsch | i.e. functions from code to code | 13:59:56 |
Alyssa Ross | Why would we need macros? | 14:00:04 |
Alyssa Ross | Lisp people are very fond of insisting everything needs macros, IME. | 14:00:18 |
profpatsch | I don’t think you need them in a lazy language without compilation pass | 14:00:18 |
infinisil | As far as I understand, the nice thing about homoiconicity is that you can write a program straight to disk | 14:01:19 |
infinisil | And then read and execute it | 14:01:26 |
infinisil | And that's mostly transparent to the writer | 14:01:35 |
infinisil | At least that's what makes guix work the way it does | 14:01:50 |
Alyssa Ross | Why would we need to do that though? | 14:02:02 |
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 |