Nixpkgs Architecture Team | 230 Members | |
| https://github.com/nixpkgs-architecture, weekly public meetings on Wednesday 15:00-16:00 UTC at https://meet.jit.si/nixpkgs-architecture | 51 Servers |
| Sender | Message | Time |
|---|---|---|
| 12 Jul 2023 | ||
| we use for bootspec | 15:38:12 | |
| To be frank, one of my hidden pleasure was that the module system is turing complete, and that people do not have to learn about functional programming to use it in NixOS. | 15:38:14 | |
it's optional behind bootspec.enableValidation because it pulls Go and this is not really acceptable for system build | 15:38:31 | |
| (except if you want to go beyond its interface and extend it, of course) | 15:38:45 | |
| and Cue has a lot of shortcomings when it comes to property checking I believe | 15:40:02 | |
| some stuff is hard to spec | 15:40:09 | |
On that I agree - recursive merging is just equivalent to functions in expressivity, but it's more natural to write configurations this way (also makes things more inspectable and easier to override if done ). | 15:42:20 | |
Ah right, I believe it's quite hard to encode custom validator beyond the builtin combinators. I think you can do something like write validation functions in Go and then glue things together at the scripting layer but it's suddenly not that simple anymore | 15:45:30 | |
| yannham: fwiw, dhall has import-boundary caching of the reduced AST | 15:45:33 | |
| And it turns out it’s a pretty expensive operation in many practical use-cases, because partially applied functions tend to blow up a lot | 15:46:00 | |
| which is something the coq-people had figured out years ago from what I heard | 15:46:43 | |
| yannham: Nix achieved maximal laziness in the past using the ATerm library (which apparently is no longer packaged in Nixpkgs 😂). The principle of it was based on hash-cons. One thought I had before, was that the Nix evaluator could hash the expression, the environment, and just cache the result of the top-level evaluations. | 15:46:53 | |
| At least aspiwack said something along those lines | 15:47:03 | |
| This While this might not work as well on NixOS, this might save a lot on function applications for Nixpkgs. | 15:47:50 | |
| Which is a big part of NixOS evaluation too … | 15:48:20 | |
| nbp: even for string concatenation some more lazy operations could be worth it, I started an experiment a while ago https://gist.github.com/Profpatsch/afb8018c504a5c775446800bb13b0eaa | 15:48:36 | |
| it uses the dlist-trick | 15:49:29 | |
| For Nixpkgs what might be worth is lazy-update operator lookup for attribute names. | 15:49:41 | |
Yeah, it's already something. But by incremental I really mean, in one file, you have a big configuration with recursive fields (might not be actually recursive, just a DAG, but fields that depend on other fields at least). You change
From what I recall, I think this is a problem quite specific to dhall: basically their normal form representation which is cached isn't able to represent sharing, so you have to substitute everything and you end up with sometimes exponential blow up. | 15:50:30 | |
| yes, you’d need sharing | 15:52:40 | |
| nbp: yes I read Eelco's paper, but I believe this was a very long time ago. I'm curious how it would fare today, on current Nixpkgs or a NixOS configuration. Hashconsing everything is a trade-off, and it'll probably slow down the computation from scratch. Might still be fine if the gain in incremental evaluation is big enough. | 15:52:44 | |
| but it’s a hard problem, no? | 15:52:46 | |
| yannham: I think that's part of the reason for removing it. | 15:53:23 | |
Honestly, I don't really know. Like this, I would be tempted to say: hash-consing could be one way (especially given that Dhall has semantic hash). Another way could be to not necessarily cache normal forms, but allow things with remaining let-bindings. But Gabriella is a smart person, so I'm most definitely missing something. Could also be due to a conflicting design constraint elsewhere that requires cached values to be normal forms (or at least makes it harder if it's not the case). Arnaud probably knows better | 15:57:01 | |
*
Honestly, I don't really know. Like this, I would be tempted to say: hash-consing could be one way (especially given that Dhall has semantic hashes). Another way could be to not necessarily cache normal forms, but allow things with remaining let-bindings. But Gabriella is a smart person, so I'm most definitely missing something. Could also be due to a conflicting design constraint elsewhere that requires cached values to be normal forms (or at least makes it harder if it's not the case). Arnaud probably knows better | 15:57:13 | |
In reply to @phaer:matrix.orgThe implementation is not too hard really! I'll try to prioritize this :D | 17:06:00 | |
| As discussed in the previous NAT meeting, once the PR is done, I'll schedule a meeting with the NAT to do a final review and merging | 17:08:57 | |
| Anybody else welcome to join too of course, call it a merge party :P | 17:09:27 | |
| Or maybe it should be scheduled already, so I have some pressure to get it done until then 🤔 | 17:09:47 | |
| 21:23:53 | ||