4 ms·
I think the true argument is that you can read the Go specification in a slightly extended sitting, whereas (for example), the current working draft for C++ is
by Vendan 9y ago
I think the true argument is that you can read the Go specification in a slightly extended sitting, whereas (for example), the current working draft for C++ is 1416 pages.
- kibwen 9y agoThe Go specification is not the same sort of document as the C++ or Java specifications. Go is doubtlessly less extensive than C++ or Java, but it would be dishonest to attempt to leverage their respective specification documents as yardsticks for complexity. If Go were submitted to a standards body such as ISO, the drafting committee would produce a more detailed and more verbose document than currently exists.
- camus2 9y agoIs the Go "specification" considered a normative spec, like ECMASCRIPT spec? And AFAIK the C++ draft also covers the std lib.
- Vendan 9y agoUnless the C++ draft is 90+% stdlib, it's still quite a difference in size (printed, which would not be a good way to use it, the Go spec is 90 pages). And I'd consider it normative, though not to the point of "spec wins if the spec and the toolchain disagree".
- neild 9y agoIf the spec and an implementation disagree, there is a bug in one or the other. (There are multiple implementations of the language.) The Go spec is not entirely normative in that a disagreement between it and the implementation may be resolved in favor of the later. It is normative in that you should be able to implement the entire language from the spec alone.
- didibus 9y agoI'm not sure Go has a spec. The page says spec, but the content says its the reference manual. So I'm guessing it's more focused on learning how to use the language then on writing an alternative implementation of it.
- crawshaw 9y agohttps://golang.org/ref/spec https://golang.org/ref/spec certainly is a specification of the Go language. Whenever a difference is found between the two Go compilers, gccgo and gc, the spec is consulted to see which is right. If the spec is not clear on which compiler is right, then the spec is changed so it is. When the third frontend was written (go/parser and go/types in the standard library), the spec played a similar role. Though far fewer changes were made to the spec, suggesting it is getting pretty good.
- didibus 9y agoOh, that's good to know. I'm happy to hear it is trying to be a language with a formal spec.