News for hackers. Stuff that matters.
Re:Reusable and type-safe options for Go APIs by jopsen on Sunday October 22, 2017 @05:14AM (#15525850)
Once you accept that the golang type system can't enforce everything your life will be easier.

Use rust or Haskell if you want a powerful type system that can do fancy things.

golang is great, but you have to accept that some things are runtime errors, and that's fine, it keeps things simple. How often are options given conditionally anyways? Simple tests will cover this in most cases.

Re:Reusable and type-safe options for Go APIs by tapirl on Sunday October 22, 2017 @07:11AM (#15526201)
No languages are perfect. Yes Go type system can't enforce everything, but it enforce many things. And Go is still language in evolving.
Re:Reusable and type-safe options for Go APIs by jopsen on Monday October 23, 2017 @02:49AM (#15531187)
My point was that complex type systems also have down sides. Even if you strongly favor algebratic type systems, you have to admit they are harder to learn (at-least initially).

The upside with golang is that it's simple and easy to adopt; tiny learning curve, and code + APIs are intended to be simple.

If you are messing around with complex patterns in golang to get more compile-time correctness checks, you are most likely not keeping it simple. And thus, have missed the most important upside to golang.

Re:Reusable and type-safe options for Go APIs by gdfhhgddhjj on Sunday October 22, 2017 @02:36PM (#15528217)
These are all true things about any language on earth, except perhaps the evolving part.