2 ms·
Portability means many things beside from being cross-platform and compilable on some compilers for the target. Many cross-platform libraries are still cumberso
by lifthrasiir 3y ago
Portability means many things beside from being cross-platform and compilable on some compilers for the target. Many cross-platform libraries are still cumbersome to compile on Windows, sometimes because they only provide Makefile and autoconf (sigh), sometimes because they have to fetch another dependencies, sometimes because those dependencies are actually system-dependent but can't be easily used [1]. Go has no such issue assuming CGO is not used, so this does relate to my point---source code portability is only a part of portability.
[1] For example, Rust `openssl` crate was notably annoying to compile for a long time, even on macOS (it took literally years to make the typical experience smooth enough). And yet it was an essential component for HTTPS! Today we would use the `native-tls` crate instead that avoids OpenSSL on Windows and macOS.
- lelanthran 3y ago> source code portability is only a part of portability. I broadly agree, but in this particular case: 1. LAME compiles just fine using multiple different compilers on Windows (including an older MSVC - newer ones will error out on the use of unsafe functions, fixed by passing a #define in a flag). 2. LAME has no dependencies to download. 3. LAME is successfully used from many other languages on Windows. So, yeah, if it's not working for him but works for everyone else, you can't blame C for portability here. OTOH, because LAME is written in C, you have even more options - don't compile it yourself. Download the compiled LAME .dll and just use it from Go. Author didn't even try the easiest option, said easiest option being possible only because it was written in C.