3 ms·
Since Rust is built on top of LLVM, what's preventing it from "just" adding the Clang C/C++/ObjC frontends into the Rust compiler, and create cargo packages wit
by flohofwoe 5y ago
Since Rust is built on top of LLVM, what's preventing it from "just" adding the Clang C/C++/ObjC frontends into the Rust compiler, and create cargo packages with cross-platform C/C++/ObjC headers and runtimes? This would make cross-compilation and C/C++/ObjC integration just as easy as with Zig (and without requiring any external C toolchain, which is the most important point).
I guess the other (simpler) alternative is to wrap Zig into a Cargo package, similar to this:
https://pypi.org/project/ziglang/ https://pypi.org/project/ziglang/
- steveklabnik 5y agoTechnically? Nothing that I'm aware of. Practically? The desire to do it, and the engineering work required to make it happen. I have been talking about how much I would love this to happen, but I can't do the work myself. Frankly, I don't contribute to the compiler, so even getting up to speed would be a ton of work I just don't have the time for.
- AndyKelley 5y agoIf Rust compiler team members wanted to collaborate on this effort, I would be open to that. We could co-maintain a separate repository with: * The collection of headers for various targets, and the tools to upgrade/maintain them. * The source files for various libcs, patches, instructions/tools to upgrade/maintain them * A declarative set of instructions to create build artifacts (not Makefiles!!) * Instructions/patches needed to integrate Clang driver frontends into a different binary (making the "main" functions co-exist peacefully). Would be a fair amount of overhead to collaborate, but perhaps could ultimately save both parties labor.