Go Is Not Good – A list of articles complaining that go isn't good enough
After a couple of years with Go, I&#x27;m neither particularly happy about, not particularly unhappy. It&#x27;s a decent language. Productivity is high, which trumps many other concerns.<p>There has been so much controversy about generics, but one related area where Go is consistently annoying is when you want to define a sort of language of data types -- where in a different language such as Haskell would define algebraic data types. For example, an AST of syntax nodes: There&#x27;s no way define this (simplified):<p><pre><code>    data Node = Literal | Identifier | And | Or | Not | EQ | NEQ | ...
</code></pre>
Instead, you must define a bunch of structs and use a dummy interface that all nodes implement. Even then, Go has no pattern matching, so if you want to handle a node, you need a switch statement on type, then check the data with an if. And even then, there&#x27;s no way to prove at compile time that the switch statement is exhaustive (you could do some runtime magic with reflection-based lookup tables, but it&#x27;s still poor). If you want a generic mechanism to traverse and rewrite such deeply nested data structures, there&#x27;s a lot of exhausting boilerplate in the way of the core logic, because, ahem, no generics.<p>I&#x27;m in the middle of a project that has <i>three</i> sets of such data structures (a low level AST, a high level expression grammar, and a query plan graph), and it&#x27;s an area where the Go development experience turns from pretty good to pretty dismal. I&#x27;ve considered writing a mini-DSL and using &quot;go generate&quot; to generate Go code, but I&#x27;ve not yet decided on the best design.