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

audit the standard library API and implementations #1629

Open
andrewrk opened this issue Oct 3, 2018 · 4 comments
Open

audit the standard library API and implementations #1629

andrewrk opened this issue Oct 3, 2018 · 4 comments
Labels
breaking Implementing this issue could cause existing code to no longer compile or have different behavior. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Oct 3, 2018

  • Code review for implementation robustness
  • API correctness, robustness, consistency, and future proofing
  • Review all fully qualified names
  • Remove unnecessary APIs. They can go into third party maintained projects/packages.
  • Compare with other language std libs, make sure we are not missing some critical component
  • convert TODO comments from source code into issues #363
@andrewrk andrewrk added the standard library This issue involves writing Zig code for the standard library. label Oct 3, 2018
@andrewrk andrewrk added this to the 1.0.0 milestone Oct 3, 2018
andrewrk added a commit that referenced this issue Jan 5, 2020
 * add reserved field to match musl struct definition so that
   it will work with musl libc.
 * add libc getrusage so that it will work with libc

what's not done in this branch is:
 * test coverage. See #1629, which should also aim to provide
   general test coverage for the std lib.
 * rusage struct bits for non-linux operating systems
@schmee schmee mentioned this issue Jan 14, 2020
@andrewrk andrewrk added the breaking Implementing this issue could cause existing code to no longer compile or have different behavior. label Mar 3, 2020
@jayschwa
Copy link
Contributor

Does naming consistency fall under this issue? It seems like there's a mix of long versus shortened names (e.g. eql or len).

@iacore
Copy link
Contributor

iacore commented Nov 23, 2021

tl;dr: use code generation for data structures then we only need to audit the code generation part

Maybe we should name standard library functions based on some established library standard like Progsbase. We don't need to write test cases ourselves since it's provided by the standard library standard.

Non-IO functions can be easily generated from existing code in another language. It's possible to use code generation to make entire Progsbase library available in Zig, so how big a standard library do we want Zig to have? We should have a discussion on this.

On code generation, aside from Progsbase, it's easy to generate code from any language with similar memory model (no RC or GC). We may also implement a new back-end for Haxe and generate standard library that way.

@iacore
Copy link
Contributor

iacore commented Dec 20, 2021

There are so many issues about the standard library. I want to create a project at https://github.com/ziglang/zig/projects?type=beta but I don't have permission. @andrewrk can you do it?

We probably also need a code review solution for (crowd-sourcing) reviewing standard library.

andrewrk pushed a commit that referenced this issue Aug 28, 2023
`TailQueue` was implemented as a doubly-linked list, but named after an
abstract data type. This was inconsistent with `SinglyLinkedList`, which
can be used to implement an abstract data type, but is still named after
the implementation. Renaming `TailQueue` to `DoublyLinkedList` improves
consistency between the two type names, and should help discoverability.

`TailQueue` is now a deprecated alias of `DoublyLinkedList`.

Related to issues #1629 and #8233.
@perillo
Copy link
Contributor

perillo commented Jan 23, 2024

Currently some namespaces like compress and crypto are hierarchical. Is there a plan to add more of these, like:

  • encoding (for json, base64, leb128?)
  • archive (for tar, zip?)
  • container (array_hash_map, array_list, hash_map, linked_list, multi_array_list, ...)
  • rt (for start, start_windows_tls) (the name rt is used both in C and Hare)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Implementing this issue could cause existing code to no longer compile or have different behavior. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

4 participants