←back to thread

257 points pmig | 2 comments | | HN request time: 0.537s | source
Show context
owlstuffing ◴[] No.43097059[source]
Going back to first principles, nominal typing is what I miss most with Go. I get the utility of structs + interfaces + structural typing, but most of the time there is more benefit in declaring that a type nominally implements an interface when that is the intention. Code is far easier to read and understand that way, both for developers and tooling.

I suppose exclusively structural typing would be more acceptable if Go supported _real_ interface composition, like Scala with traits or true delegation via the manifold project[1] for Java. But that's missing as well e.g., does not inherently fix the Self problem, etc.

Considering Go's initial goal, which was IIRC a better systems language, then yeah, sure it's an improved C. But now that Go is routinely compared with Java/Kotlin and friends, I personally don't see it, particularly wrt the type system, to be taken seriously as a Java contender. Shrug.

1. https://github.com/manifold-systems/manifold/blob/master/man...

replies(4): >>43097336 #>>43098207 #>>43100050 #>>43100109 #
1. throwaway2037 ◴[] No.43098207[source]

    > But now that Go is routinely compared with Java/Kotlin and friends
Do you think Go is "moving up" (away from systems prog) or is Java "moving down"?
replies(1): >>43098864 #
2. owlstuffing ◴[] No.43098864[source]
> Do you think Go is "moving up" (away from systems prog) or is Java "moving down"?

I haven't been keeping score, but I've read other articles like this one claiming Go as an enterprise language alternative to Java. Not much concerning Java as a systems language, but that makes good sense. I see Go v. C/Rust, not Go v. Java/Kotlin. Just my take.