Accidentally starting a community project in Go
Gonum: Consistent, composable, and comprehensible scientific code
Dan Kortschak
Golang Adelaide
Dan Kortschak
Golang Adelaide
Hired to revise a genomics analysis tool written in C (in the style of Fortran)
Hit limits of revisibility due to design of the code
Rewrite!
3My background is not software engineering
Needed something simple enough to pick up quickly, but adequately performant
I had played with some Go the previous year (originally released in late 2009)
The design simplicity and nearish performance characteristics looked appealing
4Leads to pain — critical tools without support and often only just barely working
5"The language is based on design principles intended to promote rapid and efficient software development and reduce the barriers to entry for new developers — language features should be `simple', `orthogonal', `succinct' and `safe' (R. Pike, JAOO Conference 2010)."
"These characteristics, the language implementation and its supporting tools are well aligned with the principles for scientific computing described by Wilson et al. (2014)"
6The original problem required some basic bioinformatics routines be written
Quietly ... some months later, bíogo was finished
This made the original problem trivial except...
7int was 32 bit (so slice and array length limited to 2G elements)These were all fixed by Go1.1
8
The packages included some linear algebra (Cgo-based) and graph analysis routines
Partly for exploration and partly for solving the original problem
This attracted other users of Go from the science domain ... refugees from MATLAB, C++ and others ...
Lead to a community effort to create a suite of packages for doing analyses using Go
10Initial discussions were on G+
Focused around:
[]float64 handlingProgressed to include numerical optimisation functions
Attracted additional committed contributors to packages at github.com/gonum
12
The people who contribute generally do so because it's fun
13I recall Russ Cox discussing bootstrapping of the culture in a talk
"I do think it was important to engage with everyone especially at the start, and then as other voices got up to speed and were able to handle most questions, we were able to step back."
This helped build a strong early community of people wanting to build the things that were missing at the time
14For the majority of the project the four main contributors lived on separate continents
The first time meeting each other f2f or by video chat was this year
Doing the same kind of thing in different settings should look approximately the same
(this is not R or perl)
Behaviour should be clearly documented and magic should not enter the picture
(R, I am looking at you)
interface{} in exported code"Don't panic" get's into the go-proverbs.io list from Effective Go but was not in the talk.
Effective Go says:
But what if the error is unrecoverable?
Sometimes the program simply cannot continue.
Gonum follows the principle that incorrect software in a scientific setting should not continue running
In the world of bioinformatics, incorrect results can lead to significant harm (erroneous drug trial approval for example)
Otherwise, idiomatic Go code
21We conducted a user survey recently — the majority of user responses indicated for-profit organisations (6x higher than academic users)
22From the survey...
These are going to happen — hopefully soonish, but external help is greatly appreciated
23What people have to say about Gonum: "If it could bother to do releases, it would be a shining example for other Go projects."
I think, after about 6 years, we are now near a 1.0.0 release and API stability
24Dan Kortschak
Golang Adelaide