4 ms·
> Isn't the whole point of a native Go/whatever version to avoid the interop penalty? CGO require a c compiler (not always easy available) and make cross-compi
by hexmiles 4y ago
> Isn't the whole point of a native Go/whatever version to avoid the interop penalty?
CGO require a c compiler (not always easy available) and make cross-compilation harder
- c0balt 4y agoDumb question, on which system with a go compiler is a C compiler hard to install? Most *nix distros either come with gcc (and/ or clang) already or have it easily available as a package. AFAIK the same is applicable for MacOS with homebrew. Is this a problem for windows users or am I overlooking someone? I'm genuinly interested since I've recently started with Go and would like to use cgo in the future.
- hexmiles 4y agoMy primary use case is windows and embedded. Also sometimes while the compiler is easy to install, make c compilation work seamlessly across multiple machine with unreliable vendor toolchain or weird path issue where the compiler can't find the correct header/library are not that uncommon.
- c0balt 4y agoThank you for your response and perspective. I didn't consider the various toolchains and environments from this POV. Your points make sense and are very helpful.
- fileeditview 4y agoIt also makes it harder to debug or do performance profiling. Or to manage builds in CI/CD.. there is a lot of cost to CGO. I still would not rewrite SQLite. It's just too good how it is.