Some libc functions can obviously share a common implementation. For example, right now, musl, mingw, the zig standard library all have independent implementations of the math functions, such as sqrt.
Instead, the canonical implementation should be in Zig, and even when providing musl or mingw libcs, the zig code should be built and used to fulfill those dependencies.
Other examples of functions would be memcpy and strcmp.
Functions that would be tricky to have common implementations would be, e.g. fopen. But that's worth investigating as well.
Instructions for contributing to this effort.
Some libc functions can obviously share a common implementation. For example, right now, musl, mingw, the zig standard library all have independent implementations of the math functions, such as
sqrt.Instead, the canonical implementation should be in Zig, and even when providing musl or mingw libcs, the zig code should be built and used to fulfill those dependencies.
Other examples of functions would be
memcpyandstrcmp.Functions that would be tricky to have common implementations would be, e.g.
fopen. But that's worth investigating as well.Instructions for contributing to this effort.