|
|
|
|
|
by crawshaw
4130 days ago
|
|
Lightweight goroutines depend on small stacks. General API design in Go depends on lightweight goroutines. In particular, Go style is to never write asynchronous APIs. Always write synchronous blocking code, and when you need to work concurrently, create a goroutine. You cannot do this in C with pthread, because OS threads are too heavyweight. So you end up in callback-based APIs that are harder to use and harder to debug (no useful stack traces). This small feature has a surprisingly wide-ranging effect on the use of the language. It is a very big deal. Go is very much about reinventing these low-level things. |
|
Furthermore it's extremely easy to use non-contiguous stacks in C just by knowing the stack amount used by functions, which the compiler already knows.
This is a totally absurd reason to reimplement an entire toolchain.