Re:In-memory key-value store in C, Go and Python
by enneff on Wednesday March 21, 2012 @07:20PM
(#3737340)
gccgo 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.
Re:In-memory key-value store in C, Go and Python
by apaprocki on Wednesday March 21, 2012 @10:05PM
(#3737965)
Is 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.
Re:In-memory key-value store in C, Go and Python
by enneff on Thursday March 22, 2012 @08:47PM
(#3742932)
Gold is an ELF linker. I don't think it was designed to support other object formats, so it's non-trivial at the least.
Re:In-memory key-value store in C, Go and Python
by 4ad on Friday March 23, 2012 @05:49AM
(#3744321)
gccgo 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.
Re:In-memory key-value store in C, Go and Python
by drivebyacct2 on Wednesday March 21, 2012 @12:17PM
(#3735043)
Uh where is python available that Go is not and how portable is that C code:
Re:In-memory key-value store in C, Go and Python
by apaprocki on Wednesday March 21, 2012 @01:44PM
(#3735499)
I 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.
Re:In-memory key-value store in C, Go and Python
by tptacek on Wednesday March 21, 2012 @02:16PM
(#3735657)
For a long time, Redis didn't even have a configure script; you just typed "make" and it worked. It's scrupulously portable code.
Re:In-memory key-value store in C, Go and Python
by apaprocki on Wednesday March 21, 2012 @02:29PM
(#3735744)
Aside: 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....
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.