Real Go Projects: SmartTwitter and web.go
blog.golang.org
blog.golang.org
Personally I'm of the opinion that language expressiveness matters more than real world performance, but only to a limit. Go is definitely carving out a nice niche for performant systems-related apps.
And the fact that Smart Twitter serves 90k concurrent users from a VPS without breaking a sweat is freaking amazing. I suspect this is the reason the service can remain free.
(edit: err, for the "watched" categories)
So it seems too slow for systems programming and too "blind-folders on" about where CS is going. I'm honestly curious, what are people actually excited about?
The only scenario I could see people using it is in the situation where speed is not of the essence but memory consumption is. Perhaps I'm naive and this is a bigger category of software than I'm aware of.
On a related note, you sound very "dynamic language" centric. Some people actually like static typing, and i won't relaunch the debate here but both sides have pretty good argument, especially when you throw type inference into the mix.
In the static camp, here is a few advantages i can see to go (i'm not actually an user of the language) :
- Easier to get your head around than Ocaml/Haskell - Arguably better than java (pros: actually has proper closures, and a sane system for polymorphism. cons: no generics) - Compiles to machine code rather than byte-code, so doesn't depend on a VM. Can be important for some tasks.
I actually think Go has quite a lot going on for it. It just doesn't have any 'wow' factor. But that's not necessarily a bad thing
But "dependence" on VM is nothing tragic if the GC is not in the game. If you'd imagine a VM without GC then what remains is just the potential for run-time JIT and optimization which can actually be a good thing! There's a long history of p-code interpreters which provided the more compact code, see http://en.wikipedia.org/wiki/UCSD_Pascal and http://en.wikipedia.org/wiki/Microsoft_P-Code At that time tracing and JIT would have been too heavy thing to do but today it could maybe be interesting to have something like that.
And as far as I know, Go doesn't "depend" on VM but does on GC, but D also generates the native code but doesn't have to use GC and I think that is an important advantage for such a kind of the language.
In the type of code we do (distributed systems programming) speed is almost always directly dependent on memory consumption and layout. For the parts of our codebase that are purely CPU bound Go is about 2x slower than C, fast enough that we haven't yet felt the need to rewrite in C and use GCC. For the rest of the system we get a nice flexible statically typed language that has good support for concurrency. Previously a similar project would have used Erlang/Python/C on the server side, now we can just use a single language.
YMMV, we (tinkercad) do data and computation intensive problems which fits the original design goal of Go pretty well. Plus we find that C/C++ programmers can transition to the language quite easily, which is a plus given the domain of graphics and computational geometry is still filled with a lot of people who have mainly used C++ for performance reasons.
It's probably a stretch but considering the speed difference between RAM and the harddisk, real life speed of an app has a very close inverse relationship to memory usage. Go uses very little memory, and I don't just mean the runtime itself. Contrary to Java it doesn't treat everything (other than primitive types) as reference types, which hugely reduces the number of pointers.
I think Go is very promising. It's going to be very fast, it's very memory efficient, and it makes massive parallelism incredibly simple. It greately reduces the pain and inflexibility of statically typed languages through type inference and after the fact interface conformance (or whatever the proper name for that feature is)
If that was true, taking regex-dna and pi-digits and binary-trees out of the data would shift the median significantly - (last time I checked) it doesn't.
However it is an explanation for that 13x slower data point.
type Foo interface {
Bar()
Baz() string
}
type Something struct {
// ...
}
func (s *Something) Bar() {
// ...
}
func (s *Something) Baz() string {
// ...
return "a string"
}
func DoFoo(foo Foo) {
// ...
}
func main() {
f := new(Something)
DoFoo(f)
}
You don't have to explicitly implement interfaces, if your data structure provide interface functionality then you can use it as that interface.This is literally the only means of inheritance the language provides, it is extremely simple, yet really rather powerful; it permits generalisation without having to modify the data structures you want to generalise over.
There are many other instances of this kind of restrained taste throughout the language, which I think places it well into 'very nice language' territory, regardless of perf comparison.
In any case, perf can only improve; what is important, i.e. the design, is solid, so I expect we'll see perf improve nicely over time.
And that's not to mention that it is specifically designed to compile very fast. Something that becomes important when you are comparing it to the likes of C++ which can take, ahem a /little bit longer/ to compile...
I'm not saying that those benchmarks don't have value, but saying that Go's barely faster than the best dynamic languages doesn't ring true to me.
Go on x86 doesn't seem to perform as well as Go on x64
http://shootout.alioth.debian.org/u64/benchmark.php?test=all...