Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is very tastefully designed, most notably 'true' interfaces, e.g.:-

  type Foo interface {
  	Bar()
  	Baz() string
  }
  
  type Something struct {
  	// ...
  }
  
  func (s *Something) Bar() {
  	// ...
  }
  
  func (s *Something) Baz() string {
  	// ...
        return "a string"
  }
  
  func DoFoo(foo Foo) {
 	// ...
  }
  
  func main() {
        f := new(Something)
  
        DoFoo(f)
  } 
You don't have to explicitly implement interfaces, if your data structure provide interface functionality then you can use it as that interface.

This is literally the only means of inheritance the language provides, it is extremely simple, yet really rather powerful; it permits generalisation without having to modify the data structures you want to generalise over.

There are many other instances of this kind of restrained taste throughout the language, which I think places it well into 'very nice language' territory, regardless of perf comparison.

In any case, perf can only improve; what is important, i.e. the design, is solid, so I expect we'll see perf improve nicely over time.

And that's not to mention that it is specifically designed to compile very fast. Something that becomes important when you are comparing it to the likes of C++ which can take, ahem a /little bit longer/ to compile...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: