-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
rewrite disko in C++ (WIP) #887
rewrite disko in C++ (WIP) #887
Conversation
return nix_Args; | ||
return dry_Run; | ||
return omit_Check; | ||
return verbose; |
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.
Are multi-returns like this in C++ even an actual feature? I would expect the first return to immediately end the function.
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.
fixed, now function adds variables into array and returns it.
I think you might have misunderstood what "rewrite" means in the context of #789. A rewrite of just the CLI entrypoint in another language will solve nothing. We need to re-implement all the If you want to make a case for C++ being a good language for this rewrite, you need to show a PoC of that. This is a high ask, I know, but I've been working through multiple iterations of the Python rewrite and haven't even reached that point yet; I myself have not yet shown that a rewrite in Python is even feasible. |
No, i understood it correctly. CLI entrypoint is just the beginning of this, I'm going to reimplement those functions and make other minor changes. |
Okay, good. But in that case I'll unsubscribe from this PR and would ask you to mention me again if anything interesting comes up. I don't want to get pinged every time you push a commit. |
If I am honest, I don't feel comfortable maintaining disko if it was written in C++. I maintain a few C++ project and I run into way too many footguns and we would have the issue that we have to compile inside an installer when used in nixos-anywhere beyond just the entrypoint CLI. |
Wouldn't we have to compile inside an installer in any way? I don't think this is C++ specific problem. Also (at least for now) maintaining C++ code feels not so bad and hard. However, if you insist, I can rewrite this in other language. But which one? |
My preference would be Rust over C++, however the lower bar to entry in Python is also nice If we just passed a JSON blob to a compiled program then you wouldn’t need to build it locally if it was cached by Hydra/packaged in Nixpkgs |
The rust toolchain is also too big to be downloaded in an in-memory installer. Further details in #789 |
I think, I prefer the python approach that @iFreilicht is following. pythonMinimal is still way smaller to upload than a whole gcc toolchain. |
@Mic92 python requires toolchain to be downloaded while gcc toolchain is included in NixOS live iso by default. Also, as I said previously, we can use binary cache with C++, but we can't go that way with python. Using C++ seems more logical for this. |
I asked around and no one in the current disko maintainer team wants to write C++ to contribute to disko. |
Then why you were offering rewrite Disko in Rust? It has literally same syntax with C++. I really believe doing this in Python is BAD idea. C++ has better syntax (imo),logic and speed. I am ready to maintain C++ code, project is not so big and hard. |
I brought it up purely because it is a modern language. You'll notice that we didn't choose it either, for exact same reason.
It literally does not.
And I don't. The reasons for this have been established.
Prove it, then. Make a fork, show us how easy it is. Talk is cheap. I will lock this discussion, it is not useful to anyone. |
@iFreilicht as i promised, my current code. for now, only basic functions implemented. it feels bit shitty for me, waiting for response and advice , thx.