3 ms·
Go is in a much worse situation here since the toolchain doesn't give you any help with C dependencies. In Rust you can mostly just wrap the C library as a cra
by treyd 1y ago
Go is in a much worse situation here since the toolchain doesn't give you any help with C dependencies.
In Rust you can mostly just wrap the C library as a crate and the end developer doesn't need to care very much. If you want to use their system headers then you need to let them know, but that's not an issue if the headers are bundled. Cargo knows how to absorbs any C-built object files into the final binary and it just works.
In Go, in every scenario, the end developer needs to go through the effort of managing all the necessary the cgo calls when any of their dependencies use C libraries, the whole way up the dependency tree. It's really really not supported.