Skip to content
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

C API: EvalState -> nix_eval_state? #10434

Open
roberth opened this issue Apr 8, 2024 · 1 comment
Open

C API: EvalState -> nix_eval_state? #10434

roberth opened this issue Apr 8, 2024 · 1 comment
Labels
c api Nix as a C library with a stable interface feature Feature request or proposal question
Milestone

Comments

@roberth
Copy link
Member

roberth commented Apr 8, 2024

Is your feature request related to a problem? Please describe.

After using the bindings a bit, I've noticed that we currently have a mix of CPlusPlusLike identifiers and nix_c_api_identifiers for types.

Maybe the rule is that types with a direct C++ equivalent reuse that name? Even then it's probably not consistent now, and too arbitrary, as the C++ code can change over time.

My apologies if this has already been discussed.

Describe the solution you'd like

Switch to snake case for all types? E.g. nix_eval_state, nix_store_path, ...

We could add deprecated typedefs to help the existing bindings switch without breaking them.

Describe alternatives you've considered

  • Leave as is -> confusing

  • Change to CamelCase like the C++ code -> iirc we decided against this, so that it's obvious which API is used

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added feature Feature request or proposal question c api Nix as a C library with a stable interface labels Apr 8, 2024
@roberth roberth added this to the Stable C API milestone Apr 8, 2024
@jlesquembre
Copy link
Member

I also think it makes sense to switch to snake_case.

I'm happy to open a PR for these changes if we agree on it. But I don't think we need to add deprecated typedefs if we do the change soon. Currently, we almost don't have any bindings, and we are introducing other breaking changes anyway.

roberth added a commit to hercules-ci/nix that referenced this issue Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c api Nix as a C library with a stable interface feature Feature request or proposal question
Projects
None yet
Development

No branches or pull requests

2 participants