Go: 90% Perfect, 100% of the time.

"GoCon Tokyo"

31 May 2014

Brad Fitzpatrick

Hello!

"60% of the time, it works every time...."

"That makes no sense"

Starting a new project, picking a language...

Disclaimer

2010

Idea: Camlistore

Which language to use for Camlistore?

Before Go

Perl: The Good

Python, Ruby, Javascript: The Good

Perl: The Bad

Python, Ruby, Javascript: The Bad

Summary

Fun vs. fast

Maybe mix of two languages?

But...

Server? Threads or events?

Threads

Executor pool = new ScheduledThreadPoolExecutor(/* ???? guess a number */);

Events

Concurrency and performance

It's really hard to pick a language!

2010. Let's try Go!

Go: 90% Perfect, 100% of the time.

Go: 90% Perfect, 100% of the time.

Before Go

After Go

Go's Concurrency

for {
  conn, err := listener.Accept()
  // check err
  go serve(conn)
}

Concurrency before Go

After Go

Go is showing up for all sorts of tasks

Web frameworks

Image processing

Crypto

Replacing shell scripts

Camlistore

Controlling flying drones

Emulators

Disassembler, linker, compiler.

Mobile

Audio synthesis

Cloud infrastructure

Load balancers & servers

Raspberry Pi GPIO

What other language is used for all these?

Go!

And even better...

Go built-in tools

So why isn't Go perfect?

Generics

No generics (Simon Peyton Jones: "Haskell is useless")

Data races can happen

$ go test -race

Code generation

gccgo

Compiling to JavaScript isn't yet great

Limited Mobile Support

Embedding Go in C/C++/Java/etc

Shared libraries

Garbage collector

Hot stack splits

But...

Go for everything

Thank you