Re:Problems with the Golang runtime and toolchain
by ori_b on Tuesday January 06, 2015 @05:22PM
(#8847499)
> The Solaris port was definitely slowed down by the fact that on other Unix systems, Go encodes the system call table.
Is there any reason that you can't just encode the system call table on Solaris too?
Re:Problems with the Golang runtime and toolchain
by 4ad on Thursday January 08, 2015 @07:30AM
(#8856089)
Yes, unlike Linux, the system call table is not guaranteed to be stable. Also, libc does a lot of things, like set up TLS. It's also critical in the signalling path.
Re:Problems with the Golang runtime and toolchain
by ori_b on Thursday January 08, 2015 @12:40PM
(#8857594)
If the system call table isn't stable, how can you ship statically linked binaries?
Re:Problems with the Golang runtime and toolchain
by 4ad on Thursday January 08, 2015 @12:53PM
(#8857694)
On Solaris you don't ship statically linked binaries. All Go binaries are linked with libc.so. In fact, amd64 Solaris doesn't even support statically linked binaries at all. It won't exec them.
The situation is exactly the same as on Windows. Windows Go binaries are dynamically linked agains Windows standard libraries, and Go binaries use the shared libraries instead of doing system calls themselves.
What can I say :). I love the Plan 9 assembly. It's the same on every operating system (even though the calling conventions are different on different systems!). It has some higher level constructs that make the assembly more consistent between different hardware architectures. It's verifiable, to some degree, by go vet.
It's not great, there's nothing great to it; in many respects it's old fashioned and anachronistic (static register, really? In Go?), but it works just fine. Other assemblers work fine too. I never felt the need to complain about assemblers. They are such a tiny, trivial, implementation detail I am amazed to see them mentioned at all.
As for the Plan 9 C dialect, the Go toolchain recently removed the C compiles, so I don't see the point of discussing Plan 9 C at all, although I like Plan 9 C quite a lot too.
The linkers work the way they work because they originally supported only static binaries. I don't like the linkers at all, although I like what they do. Cross-compilation is a marvellous thing. The code sucks though, I hate it. But there are new linkers in the work. While I can rant away for days about the linkers (I hate the fucking code), I can't complain about the features. I love the features and how they work. I can just complain about the (inappropriate) code.
The Solaris port was definitely slowed down by the fact that on other Unix systems, Go encodes the system call table. I had to add ELF support for linking with shared libraries, in order to not encode the system call table on Solaris. But I only had to do that once. Say, if I port Go to Haiku (God forbid), the code will now exist, and it will work. If Go supported linking with shared libraries from the beginning, someone would have still written that code. ELF shared library support takes time to write and it's irrelevant (from my perspective) whether I had to do it or someone else. Someone has to write it at some point, the total engineering time spent is the same.
As for the portability of the toolchain, it's pretty portable, though porting to a new operating system is a too minor of a job for that too matter. Time is dominated by other effects. But you can see it if you port it to a new architecture. I am doing the arm64 port, and the Go compiler was very easy to port, much easier than say, gcc.