Well, to be fair, the Go spec is missing several parts of the language, such as finalization, thread safety (the memory model, sync points or other happens-before relationships), goroutine memory/stack usage, anything to do with go modules.
Still, even if they added these, it would likely stay significantly shorter than even Java.
> finalization, thread safety (the memory model, sync points or other happens-before relationships), goroutine memory/stack usage, anything to do with go modules
I dont think it affects your point but those are implementation details rather than features of the language itself. Obviously it's still important to understand the language implementation so you can make reasonable guesses about performance etc. when you're programming.
With the exception of goroutine memory/stack usage perhaps, these are not implementation details - they are core parts of the semantics of the language (especially since asynchronicity is a fundamental aspect of the language through goroutines).
For example, is this piece of code correct?
x := 7
go func() {
if x == 7 {
fmt.Println("x = 7")
} else {
fmt.Println("x != 7")
}
}()
x = 8
What are its possible valid outputs? (for the record, as far as I know this is incorrect code in Go, as atomic access is not guaranteed for any variable, so not only could this print any of the two outputs, it could also observe invalid values for x)
What about this code:
x := 7
c := make(chan struct{}, 0)
go func() {
if x == 7 {
fmt.Println("x = 7")
} else {
fmt.Println("x != 7")
}
c<-struct{}{}
}()
<-c
x = 8
Can you tell from the language spec whether this code is safe, and what it's output will be? (~~it's not safe, as far as I know~~ reading the memory model[0], I believe it is safe).
Still, even if they added these, it would likely stay significantly shorter than even Java.