Sydney Go Meetup 2014-11-19
Optiver is a propietary global market maker, trading on all major financial markets around the world, putting only its own capital at risk. Making markets in financial products is Optiver's core business.
We're a polyglot company:
We're hiring!
One of our server-like products is implemented in Python. But it has problems:
We've been chipping away at this problem for about a year.
We tried a few different things before trying out Go.
We implemented a small prototype of our server product using Go. We tried Go because it's advertised to be:
That was enough to tempt us.
// File: validate_test.go
// Dummy validate validates all inputs as being good,
// since in testing we don't care about validation.
func dummyValidate(x int) bool {
return true
}
// File: validation.go
var validates func(int) bool
validates = dummyValidate // This won't compile!
if validates(badInput) {
// stop something bad from happening!
// ...
}
How can we be confident that they work?
Tested?
Feature complete?
Go is now compared to other technologies such as C++ and Python. Ecosystem isn't as well evolved.
C++ ⇨ Google Mock and Google Test framework.
Initially Go's standard 'testing' library seemed lackluster...
type FooInterface interface {
Bar(int) bool
Baz(string, int)
}
type MockFoo struct {
FnBar func(int) bool
FnBaz func(string, int)
}
func (f *mockFoo) Bar(x int) bool {
return f.FnBar(x)
}
func (f *mockFoo) Baz(s string, x int) {
f.FnBaz(s, x)
}
DB Schema (XML) ⇨ Jinja2/Python script ⇨ C++
Surely we can do the same with Go?
Some language features of C++ don't transliterate well:
When we solve this, it's really going to test out Go compiler performance. We expect ~250K Go LOC.
No Go support.
Not a show stopper for us:
We're concerned that there's no guarantee that more things won't break in future Go releases on Centos 5.
Vendored code is mirrored on internal SVN/Git servers and pulled in as externals.
One GOPATH per project:
.
|-- projectA
| `-- src
| `-- optiver.com
| `-- ...
`-- projectB
`-- src
`-- optiver.com
`-- ...