by sesm · 3y ago · 0 comments
Go was designed for internal use at Google, and one of the primary goals was to reduce compilation time for huge codebases (the size of Google monorepo). For such amount of code even `javac` was too slow for them. To solve this problem, Go was designed to be compiled with 1-pass compiler (similar to Pascal and Modula-2) which makes features like generics and type inference very hard (if not impossible) to implement.
ISO Modula-2 common extensions (including generics),
https://modula2.awiedemann.de/manual/comp3.html
While using Go is certainly better than plain C, most of its design steams from the authors' bias.
I was under the impression Go originally avoided generics more for a perceived abstract complexity for developers, the idea being they are hard to understand for new recruits.
Creating a new general purpose language with such a limited feature set - that it’s likely to result in even more code - seems to be an odd solution.