News for hackers. Stuff that matters.
Re:Go's power is in emergent behavior by aboodman on Sunday April 27, 2014 @12:52PM (#7655792)
I've never worked in a language that allows you to declare some type you don't control adheres to an interface. Just out of curiosity and in case anyone else reading has the same question, can you list some? Coming from Java and C++, this is part of the value I see in Go's implicit interfaces.
Re:Go's power is in emergent behavior by eridius on Sunday April 27, 2014 @01:44PM (#7655991)
Rust is the language I'm thinking of right now. If you declare a trait (what Rust calls interfaces), you can also implement that trait on any type.

The basic rule is you can implement a trait on a type if you declared either the trait or the type yourself. You just can't implement someone else's trait on someone else's type.

But Obj-C also allows for the same thing. You can declare @protocol (interface) conformance in a class category, and you can declare your own category on someone else's type.

Re:Go's power is in emergent behavior by pcwalton on Sunday April 27, 2014 @01:11PM (#7655868)
Scala and Rust. Haskell, if you consider typeclasses interfaces.
Re:Go's power is in emergent behavior by aboodman on Monday April 28, 2014 @03:32PM (#7662347)
Thanks! One of these day I would like to do some side projects in each of these.