It's Go time!

Camilla Romander & Andreas Gustafsson

Abstract

The purpose of this report is to evaluate the functionality and syntax of Googles new programming language: Go! To achieve this goal, several tests will be conducted. Trial-division, naive and optimal versions; The Sieve of Eratosthenes; Fibonacci generators, iterative, recursive and recursive with memorization; a small math-based game; and a wiki will be implemented. For comparison, each test will also be implemented in three other major languages: C, Java and Python. The powers of Go is its (allegedly) smooth syntax and fast runtime. It feels like an interpreted, dynamically typed language but is in fact a compiled, statically typed language. Overall Go performed very well, it was faster than both Java and Python (even when not counting Javas extra second to boot the virtual machine) and in most cases as fast as C. In addition to the good runtime, it was easier to implement the tests in Go than in C and Java thanks to the simple syntax and orthogonality of the functions and packages.