News for hackers. Stuff that matters.
Re:Go and Simplicity Debt Redux by majewsky on Monday June 19, 2017 @06:07AM (#14585742)
> There have been research variations of Java that accomplished this: instanceof checks insert implicit casts on branches where the instanceof check is true.

By the way, Go already has this. If you have a variable, say `foo`, with a generic type, say `interface{}`, you can say

  switch foo := foo.(type) {
    case MyFirstConcreteType:
      //foo is a MyFirstConcreteType instance here
    case MySecondConcreteType:
      //foo is a MySecondConcreteType instance here
    default:
      //foo is still the generic type here
  }
See https://golang.org/doc/effective_go.html#type_switch for details.
Re:Go and Simplicity Debt Redux by brandonbloom on Monday June 19, 2017 @12:06PM (#14587970)
Yup! Type assertions work this way too. It's a much nicer design than traditional casts.
Re:Go and Simplicity Debt Redux by frou_dh on Tuesday June 20, 2017 @08:02AM (#14593848)
Check this out. With this tool, the type switch gets you exhaustiveness checks for hokey package-private sum-types in Go :)

https://github.com/BurntSushi/go-sumtype