Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Why Go Is Not Good. Parent comment
Also, the type-switch on interface {} is ugly.
Consider how an AST looks like in Haskell:
data AST = LiteralInt Int | LiteralFloat Float | List [AST] ...
case ast of LiteralInt int -> ... LiteralFloat float -> ... List nodes -> ...
Also, if you add an annotation to each AST element (e.g: inferred types), you can very easily and safely map over them, etc.
There are no comments on this comment yet.
Also, the type-switch on interface {} is ugly.
Consider how an AST looks like in Haskell:
And then an eval looks like: and it is safe, rather than interface{}, you get the AST type and you get exhaustiveness checking that you covered all cases.Also, if you add an annotation to each AST element (e.g: inferred types), you can very easily and safely map over them, etc.