4 ms·
I don't see Go as a panacea for opening up libraries for use. You're still going to see languages that can export C interfaces for that. It's going to be C, C++
by Spartan-S63 8y ago
I don't see Go as a panacea for opening up libraries for use. You're still going to see languages that can export C interfaces for that. It's going to be C, C++, and Rust that are likely to persist as the languages of choice for massively consumable libraries. As long as they can export a C interface, you can get low (or no) overhead interop. Go's biggest disadvantage is that it ships by default with a runtime.
I hope I'm understanding your comment correctly.
- bigdubs 8y agoC interop can introduce a lot of complexity in the build toolchain. It's nice to have native versions of libraries like this, vs. relying on compiling c/c++/rust versions.
- kodablah 8y agoI meant translate the actual Go code to Swift code so it's pure Swift, but the effort to implement the algorithm right is removed. But yes, to support Go's features you will need at least a GC. Once Rust gets async/await down and people run with it, a static lib in Rust w/ an exported C interface might instead be the norm. But in the meantime, it's annoying that the options are to either reuse a complicated/unsafe C/C++ impl or re-impl in each language individually. Go has a terrible C export story with lots of limitations and impedance mismatches so that's not a great approach imo (granted it's what gomobile does iirc).
- Spartan-S63 8y agoAh, I understand now. Yes, translating from a Go implementation to a Swift one would erase most of the complexity of reimplementing the algorithm (in a potentially error prone way). I agree that once Rust lands async/await and it matures, it could be the go-to for safe, cross-platform libraries. That's my hope, too. I'm selfishly a Rust evangelist.
- pjmlp 8y agoOn Windows we have better interop story via COM/UWP or .NET. On Android the interop story is Java and on the Web it is going to be either JavaScript or WebAssembly.