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

no "util", "misc", or similar uncategorized namespaces in the standard library #7135

Open
andrewrk opened this issue Nov 17, 2020 · 5 comments
Labels
accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@andrewrk
Copy link
Member

In particular this would mean that std.crypto.utils.secureZero would be rename to std.crypto.secureZero.

cc @jedisct1

@andrewrk andrewrk added standard library This issue involves writing Zig code for the standard library. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. labels Nov 17, 2020
@andrewrk andrewrk added this to the 0.8.0 milestone Nov 17, 2020
@andrewrk andrewrk changed the title no "util", "misc", or similar namespaces in the standard library no "util", "misc", or similar uncategorized namespaces in the standard library Nov 17, 2020
@jedisct1
Copy link
Contributor

Go and Javascript put that kind of functions in a subtle namespace, which I never found very self-explanatory.

To keep some namespacing, would it be acceptable to have std.crypto.mem even though we already have std.mem?

@jedisct1
Copy link
Contributor

subtle is used inconsistently and doesn't describe at all what the namespace contains. It's even worse than utils.
We can do better.

@mrakh
Copy link
Contributor

mrakh commented Nov 17, 2020

Many C++ libraries like Boost and Eigen use detail or internal as sub-namespaces to encapsulate internal helper functions. Perhaps conventionalizing on using one of those to organize internal logic would make things cleaner and easier to find?

@andrewrk
Copy link
Member Author

To keep some namespacing, would it be acceptable to have std.crypto.mem even though we already have std.mem?

I'm fine with that but why not std.crypto.secureZero ?

@andrewrk andrewrk added the accepted This proposal is planned. label Dec 31, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.10.0 May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

4 participants