by smeg · 14y ago · 0 comments
Also, is the incompatibility between Go and C just due to the segmented stacks in Go? What about function call conventions? Anything else?
My current guesses are: 1) Performance 2) The need to call assembly code easily
The runtime needs to break the abstractions Go provide, it needs to break Go's memory model, it needs to be aware of the garbage collector, it needs to be aware of stacks, stack growths and switch them, and it needs to do other things: http://research.swtch.com/goabstract.
C was chosen as the pragmatical choice, they could have done it all in assembly (various bits are written in assembly), but C is a portable assembler.