It looks like C with some very carefully chosen additions: memory safety, concurrency and maps.
It looks like C with some very carefully chosen additions: memory safety, concurrency and maps.
"Go is mostly in the C family (basic syntax), with significant input from the Pascal/Modula/Oberon family (declarations, packages), plus some ideas from languages inspired by Tony Hoare's CSP, such as Newsqueak and Limbo (concurrency). However, it is a new language across the board."
Two of the designers were Rob Pike and Ken Thompson, both instrumental developers of Unix/C and Plan9/Inferno. Thompson created the B programming language that C was based on.
I'm excited to see CSP in Go. I've been advocating its use for concurrency since I learned about Plan 9's channels, but most people paid no attention.
And the goal, as they mention, seems to have the efficiency of a statically-typed compiled language with the ease of programming of a dynamic language but with -
Safety: type-safe and memory-safe.
Good support for concurrency and communication.
Efficient, latency-free garbage collection.
High-speed compilation.
They are aiming at a lightweight type system with no implicit conversions and no more 0x80ULL.
A good starting point is their FAQ page and also the tech talk at youtube: http://www.youtube.com/watch?v=rKnDgT73v8s
> Any type that has the named methods [...] is said to implement the interface.
For instance, in the tutorial, the cat function takes a reader interface. fmt.Print and Println a type will output whatever its String() "method" output. This is what Python does, e.g. "print x" is eqv. to "print x.__str__()".
To my understanding (and admittedly, while I've been using Python since around 1.5, I've largely abandoned it for Lua), 'Pythonic' is usually used to refer to the clearly preferred way of doing something that may have multiple implementations - Python's community making explicit the observation of conventions such as "for (i=0; i<N, i++) {" in C.
Using a dict rather than an int-indexed list is Pythonic, for example, because that's just the way that it's done in idiomatic Python, and the community encourages having one preferred idiom for common tasks. I don't think the concept applies to language features such as garbage collection.