Why Go Was the Right Choice for CockroachDB
cockroachlabs.com
cockroachlabs.com
Also the claim that you have to add extra interfaces to Java is completely false. There's no reason at all you need to add pointless interfaces in Java. Java's type system is strictly more powerful than go's type system. This was actually a design choice in go to make the language easier.
Java generics are also a huge boon when writing something like a database.
Modern C++ also would have been an excellent choice for writing a database, and would have been much more productive than go.
I was also stumped by this confidence in that Go is supposed to be better than Java performance-wise and I do think that the claims warrant some proof.
However:
> Modern C++ ... would have been much more productive than go.
I'm not up to date on current C++, but this seems like a claim much like the ones you objected to. Could you elaborate on how C++ is a more productive language (in this case?)?
They're pretty clear and honest that Go's performance characteristics are an unknown and not the reason it was chosen.
When talking about Java:
> JVM garbage collection is notoriously expensive.
> Java’s known performance issues made it unappealing.
> However, in our past experience, we ported a large system from Java to Go, which greatly decreased its memory footprint and garbage collection overhead.
When talking about Go:
> What remains to be seen, of course, is how all of this Go code will perform.
Yet: The JVM's GC is superior to Go's, Java tends to outperform Go, and a large memory footprint is a necessary evil for getting good performance out of any GC.
This is definitely not correct. Any GC language with even the most basic packaging support (go get etc.) is miles ahead of C++ productivity wise.
Go has a lot more things that can be value types than Java at the moment, which can help for some use cases, and doesn't do squat for others. I'd say it's easier to use Go in a way that lets you avoid the GC entirely, but only easier, not "easy", and when you are forced on to the GC Java will of course have the advantage, at least if you have enough RAM.
It's more nuanced than "Java is always better"... which is to some extent precisely why Java is last I knew looking at adding value types, which would tip this discussion firmly back in Java's camp from a technical point of view, probably. (At least once it matured.) I'm not sure what the current status of that discussion is; all the discussions I can dig up in Google are still saying it may go in to Java 9. Anyone with a more up-to-date link, please let me know.
This. It's true at the 100% Go backend company I work at that's never hired anyone with Go experience, and I've heard many others repeat this mantra.
While many people like to think of Go's lack of features in the realms of packaging, types, syntactic sugar, etc. as downsides, they're huge upsides when learning the language. There's just so much less to learn. Onboarding a new Go developer takes days, not weeks or months.
I have read this many times and every time I read it and it seems to me that this is just a rationalization, probably an unconscious one:
"Offering false or inauthentic excuses for our claim because we know the real reasons are much less persuasive or more embarrassing to share, or more harsh than the manufactured ones given." [1]
Maybe not the case in this particular instance, but every reason I have heard about choosing Go can be summarized as: "We chose Go because it is new new cool language. Ahh, and you can deploy by copying a single exe file"
[1] http://www.logicallyfallacious.com/index.php/logical-fallaci...
CockroachDB docs:
https://www.grockdoc.com/cockroachdb/alpha/articles
FYI: The installation docs are at the bottom of the list.
The performance potential is real but not free as the productivity isn't as good.
Also lisp is in an odd position where it has influence from functional style, but at the same time expects to have mutability always available, while Rust wants mutability to be constrained to known dynamic extents.
Now that we're stable, please let us know if you plan on experimenting with Rust. We'd love to hear how it goes (I run the SF meetups and am always looking for speakers), and what we can do to help. One of our short/medium term goals is to make some high quality bindings to other languages, so that projects like yours could slowly introduce Rust where it makes sense.
I think that someone building a product on Rust is taking a very long view and has to make an investment in the development of the language or they are at the mercy of the changes and lack of libraries.
But seriously, why not Nim?
As to performance, they expect it will be comparable to C++ and better than Java. I say "expect" because they don't provide any evidence to back that claim.
PS. I often feel like I'm walking walking on eggshells when discussing computer languages on HN. For the record, I'm neither "pro-Go" nor "anti-Go." Languages are tools, not religions. Go is just a tool: https://news.ycombinator.com/item?id=10465697
To some extent, but a lesser extent, the same could be said for Go: http://benchmarksgame.alioth.debian.org/u64q/which-programs-... (It's a bit weird reading that page, because it's broken into two graphs, but they appear to be about the same thing.)
If I were thinking "trendy language to write my next database in" personally I'd favor Rust by a country mile. This is exactly where you'd like all that stuff Rust provides just for correctness' sake, and this is the sort of task where you may even be able to outrun C++ if Rust helps you write correct code with fewer barriers slathered about for correctness.
Edit: Ha, and just below this comment as I read it I see the team commenting about Rust.
Erlang is not good for "high performance distributed" systems. It's good for systems whose primary characteristic is uptime rather than latency or throughput.
The JVM on the other hand with its stop the world garbage collector is a constant source of performance issues. Especially once you start getting over 2-4GB heaps. GC cycles can take 1s+
Though I think it's suggesting that the Golang GC is easier to tune and configure