-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC 0091] Pure Object Prototypes #91
Conversation
Co-authored-by: Francois-Rene Rideau <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a rendered link to the rfc?
I added a link to the rendered page in the intro and in the issue discussion. |
I don’t think this is an actionable change that people feel there is a need for. Can you structure the RFC in less of a rambling manner and go from a set of concrete problems in the existing code (with lots of examples) to how POP solves these issues in a cleaner manner? For examples the “Dependencies between extensions“ section is horrid, there is no reason for the reader to try and understand it, since you have not even given a reason they should be interested in this proposal. I think this needs a serious rework before anybody can be expected to read and understand it. |
I recall your original PR, the other RFC and your feedback on #83 and now I went through this one. It reads a bit like a blog and I agree with @Profpatsch you need to make a stronger case earlier on. Start for example with a list of methods we have now (you did that) and a brief list with significant limitations they have that motivate switching to POP. I do now better understand what problems you resolve, but before adding a new system, I think it is important you also understand the existing ones, which includes the NixOS modules system.
If you want to propose POP for writing package sets, then I think it is important that it is able to do what we need it to do. That is what you need it for, dependencies between extensions, but also what is listed in #83 (which is far from ready...). |
This RFC is open for nominations; @fare do you have anybody in mind who could be interested in moving this forward? |
I could nominate myself, I guess. I can also pre-disclose my position that this is likely to be valuable, but also won't move forward until there is a comparison with the module system so that trade-offs can be discussed. |
Where do I learn about modules? |
The NxOS manual might be a good place to start. Also you can also look at some modules from nixpkgs in nixos/modules Or search threw the options that come from modules in the nixpkgs repo. It also might be worth taking a look at |
Search through options is probably useless in this context, as most of the options are of the most primitive type not showing anything interesting about modules. |
I read the module documentation at https://nixos.org/manual/nixos/stable/index.html#sec-writing-modules and while it is very interesting indeed, it's a very different mechanism from the extension system / object system that POP is designed to extend.
So I'm not sure what the question or challenge exactly are with respect to "comparing POP and the NixOS module system". On the one hand, POP is a much simpler mechanism meant to replace the Nix extension system and not the NixOS module system. On the other hand, POP does have extension mechanisms with which the more elaborate aspects of the module system could be plugged in, yielding a variant of the module system that deals with imports as dependencies to be combined each a single time in a proper order. |
Of course, in comparing POP and the existing module system:
I'm actually slightly and happily surprised by how the mechanisms of the NixOS module system could by and large be plugged in as a layer on top of an unmodified POP (or rather, its instantiateMeta protocol) to yield a variant of this module system that might handle imports better. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/rfcs-looking-for-shepherds/14203/1 |
We are going to close this RFC within 2 weeks time if there are no shepherds. |
Sorry. This RFC did not seem reach the level of interests to find enough shepherds. Therefore we close it. |
If this is pursued again, I can offer to be a shepherd. I have been lacking time in recent weeks which is why I've put off volunteering here. Another thing I think would need to be pondered (maybe during discussion) is not only if POP could replace the module system potentially, but also if it could be faster (maybe with the help of a primop?). Module system evaluation speed is surely one of its main problems, to which e. g. making configuration first class in nix has been proposed even. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-02-30-nixpkgs-architecture-team-meeting-30/25973/1 |
In this RFC 0091, we propose to add Pure Object Prototypes, or POP, an object system, to the nixpkgs library. POP improves upon current Nix extension systems by supporting multiple inheritance and default values. These improvements solve modularity issues with existing extension systems. We actually use POP in production in a fork of nixpkgs to support local changes to some packages, by multiple people, with dependencies between changes.
POP can be also made to interoperate both ways with existing extension systems, with simple adapters.