Saturday 27 November 2010

Golang review

Go is a new systems programming language driven by Google.

Disclaimer: All performance claims are from a combination of personal experimentation in several projects, and from the Ubuntu x64 quad-core benchmarks, which I believe to be the best indication of future performance contrasts.

The Good
The Bad
  • Uses the := operator.
  • Syntax not similar to Python. For a new language I'm not sure there is any reason to continue using C-syntax such as braces. Providing gofmt, and requiring leading braces were excellent decisions, and a large step towards whitespace formatting anyway.
  • Preference for custom compiler bars adoption and integration with existing technologies.
  • Limited support for Windows. Despite the pain of developing for Windows, this blocks mass adoption.
  • Standard library is still evolving.
  • Won't replace C in its current state. Some of the syntax and interface advances would be most welcome however.
The Ugly
  • Performance is nowhere near C, or C++. The standard library is severely under-optimized.
  • The LLVM toolchain was not chosen to build upon.
  • Several years of tool chain development and optimization are required before Go will be a contender.
  • Documentation of the toolchain is lacking.
Language Comparison
  • Go is much faster and has superior concurrency to Python. Retains many of strengths of Python's typing system but without dynamic typing. Python has easier syntax, and a much better standard library implementation.
  • Go has better type safety than C. It also supports interfaces, closures, containers and many modern features that C lacks. Go is garbage collected, and has safe pointers. C is much faster, and has much better platform support.
  • Go is much simpler than C++, and supports many modern features that are clunky and difficult to use in C++. There is far less boilerplate. C++ is faster and has better platform support.
  • Go is faster than Java, and has less boilerplate. Its compilation speed, runtime size, and similarity to C will allow it to compete with Java's claim to portability.

    3 comments:

    Unknown said...

    "Go is faster than Java" Huh? http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=go&lang2=java

    Anonymous said...

    Braces are FAR better than indention. That is not bad AT ALL.

    Anonymous said...

    It could be said to be a matter of taste, if you start reading up on *why* indentation was chosen it starts to seem like a good idea.

    Braces are just extra line noise.