3 ms·
Thanks for doing this... I think the way to tackle a rust glibc rewrite: Step 0 - write a code generator that just generates rust code that call the C version
by rtpg 11y ago
Thanks for doing this...
I think the way to tackle a rust glibc rewrite:
Step 0 - write a code generator that just generates rust code that call the C versions of glibc symbols ( based off of the publicly exposed API in the library files). Get test suite to run
Step 1 - Make that rust code generate a 100% drop-in replacement fro the C symbols (maybe this requires injecting version numbers)
Step 2 - write the `getaddrinfo` replacement in Rust
???
Step 4 - have all of glibc ported
EDIT: Does anyone know of any gotchas with linking that would cause this to happen? Seriously considering taking a day off to do step O.
- JoshTriplett 11y agoFor step 0, look at Rust's libc crate. For step 1, you'd need to carefully look at glibc's ABI, which is even more complicated than its API due to backward compatibility and symbol versioning.
- dkhenry 11y agoYeah ABI compatibility might be problematic, my currently plan is to LD_PRELOAD what I have to test it for speed. I have the feeling that rust could mock the ABI and serve as a general replacement, but first things first is it even fast enough to use at the lowest levels of the system.
- steveklabnik 11y agoIf it's not, please file bugs. It should be.