by travisd · 4y ago · 0 comments
Saying "it all has to be in the typesystem" can _also_ become a cludge (see languages that have built-in null handling vs languages that just require you to use Option and the like)
[1] https://clang.llvm.org/extra/clang-tidy/checks/list.html [2] https://spotbugs.github.io/ [3] http://mypy-lang.org/ [4] https://github.com/rust-lang/rust-clippy
The closest I can think of is Java, where you can optionally do something during compilation with e.g. an annotation processor, which has a number of rather significant reliability and performance benefits. But that's an optional feature provided by an absurdly mature set of tools, definitely not a requirement - there are tons of java analysis tools that don't plug into javac.
If anything, this one serves as a bad example of Go's simplicity being a benefit. It's using the SSA analysis pass to do much of what a compiler does, because the compiler doesn't give you enough data to do it otherwise. It's an extremely complex workaround with only one implementation which is also built by the language developers, though it does plug into a decent framework (x/tools/go/analysis).
The language is simple enough to allow you to write analyzers in the first place. I’m totally fine with people disliking the tool (it’s purpose built for one codebase!), but I sincerely fail to see how it serves as a bad example of Go’s simplicity.