-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Language bindings and/or C interface for the Nix language #7271
Comments
Note that Nix also already has (I believe stable) Perl bindings. A slight problem with more such bindings is that it increases the build-time closure, which would be especially problematic with Haskell. This can be worked around though by not building the bindings as part of the main build, but rather just copying the source code to the result. And to make sure they work and are maintained we can still have an CI check that does the building. For improved testing in nixpkgs I'm now considering updating and upstreaming pythonix. I already managed to just update pythonix, but actually upstreaming is much harder. So before I jump in too deep:
Ping @NixOS/nix-team |
Only if it's part of the same derivation. The bindings should be in separate derivations.
+1 for me.
By putting the bindings in a separate derivation it can work the same as it does today. I'd expect at least
Also fyi, we don't have source filtering yet, so you might want to carve out the python bindings directory while you're working in it. We'll filter the source of the main package after #6538. |
Oh yeah that sounds pretty good
I don't think adding it to Pypi is needed for a start. I expect most people wanting to use this library to also have their build be done in Nix, in which case they can just use the derivation directly. |
While it's not strictly necessary, the package will be put into a namespace with the PyPI packages, whether through Nixpkgs or poetry2nix, so it's a good idea to at least claim the name. |
Started upstreaming Pythonix here: #7735 |
Yeah I think this is very import. This helps us onboard more developers, and support more downstream projects; basically this is a great example of the "force multiplier" track that @fricklerhandwerk has talked about. Having Guile Scheme libstore-only bindings would help with the NixOS/rfcs#134 future work I hope to get to, too. |
Related: #8699 |
Is your feature request related to a problem? Please describe.
Some applications' needs aren't fully met by the CLI and its
--json
flags.Examples:
Developing and maintaining programs that use the C++ code requires more effort over time, because the C++ api is not stable.
Language bindings that are developed as an integral part of Nix reduce the total maintenance effort by removing the need for multi-version compatibility. Committing to support more interfaces may increase the burden on the team somewhat, except for the Haskell bindings, which are already maintained by a team member, me.
Describe the solution you'd like
We could take one of at least two directions, or keep the status quo.
Benefits of going through C
Benefits of talking directly to C++
Both approaches are valid simultaneously, considering that a C facade and C bindings are basically the same thing. (Won't be a completely standard C library though, because of libstore's coroutines, libexpr's gc, and libexpr's stack overflow handler)
Describe alternatives you've considered
Status quo:
Additional context
The text was updated successfully, but these errors were encountered: