4 ms·
Not everyone has this problem, but Go only works on a portion of platform configurations that are available in the real world. C and Python, OTOH, are availabl
by apaprocki 15y ago
Not everyone has this problem, but Go only works on a portion of platform configurations that are available in the real world.
C and Python, OTOH, are available pretty much anywhere. Redis builds on say, Solaris, with no problem because the project is written in C and it is trivial to add the needed calls. A KV store written in Go can't support Solaris because Go itself would need to support Solaris first.
Years of tooling centered around C (e.g., autoconf/automake) is what makes most C programs cross-platform out of the box with little or no OS-specific code if you are sticking to POSIX. Until the same ecosystem develops around any new language, authors realize that choice of language alone can immediately limit their cross-platform capabilities.
- drivebyacct2 15y agoUh where is python available that Go is not and how portable is that C code:
- apaprocki 15y agoI am using Python (as well as Perl, OCaml, etc) on Solaris/Sparc, AIX/POWER7, HP-UX/IA64 on a daily basis. As for C code, If you just want to use redis as an example, I built and installed it on Solaris/Sparc with no incident. This is the case for most C POSIX compliant apps.
- tptacek 15y agoFor a long time, Redis didn't even have a configure script; you just typed "make" and it worked. It's scrupulously portable code.
- apaprocki 15y agoAside: I noticed that redis/Solaris used select() instead of the fancy new "event completion framework"[1] in Solaris 10. I figured maybe the new API would be faster and I could contribute that back, so I ported to both that framework, poll(), and /dev/poll (I feel the event API just wraps /dev/poll due to the perf #s I saw, but it isn't clear) and it turned out that select() is actually faster than any of them, which struck me as a bit odd. [1]: http://developers.sun.com/solaris/articles/event_completion.html http://developers.sun.com/solaris/articles/event_completion....
- tptacek 15y agoHe just said where.
- enneff 15y agogccgo does support Solaris, and should support any operating system that uses ELF binaries. The gc Go compiler currently supports FreeBSD, Linux, Mac OS X, and Windows. That's at least 95% of the servers out there (probably more). There is code to support NetBSD, OpenBSD, and Plan 9, but we have held off polishing it for Go 1.
- apaprocki 15y agoIs it a huge amount of work to support non-ELF formats? I haven't looked at the code, but I guess it is not using bfd? AIX uses XCOFF, not ELF. I'd be interested in finding out what it would take to add support.
- enneff 15y agoGold is an ELF linker. I don't think it was designed to support other object formats, so it's non-trivial at the least.
- 4ad 15y agogccgo works without gold, albeit not as well, some people have tried it even on Irix. iant told me even Windows might work as is, though nobody tried. In any case, it should be very easy to make Windows work as well.