-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
While working with libc bindings recently, I noticed that there's a lot of duplication there.
For example, we have four different bindings for glibc on linux for four different platforms:
But the original headers for glibc are largely identical across all platforms with only some details being target-specific.
Those are usually collected in sysdeps/.
Looking at the Crystal bindings, out of 45 files with 1000 loc in each lib_c/aarch64-linux-gnu and lib_c/x86_64-linux-gnu there are only 25 different lines. Some of the differences might even be unintentional omissions. Around 98% of the bindings are identical between both targets.
The situation is similar with musl and probably darwin. And more when we gain support for additional platforms (say aarch64-freebsd).
It seems silly to have this kind of duplication in the Crystal bindings, when the original headers are mostly shared between targets.
We could simplify the bindings a lot by avoiding this duplication. That would help to make the bindings more manageable.
Add a 👍 reaction to issues you find important.