|
|
|
|
|
by fauigerzigerk
4049 days ago
|
|
I agree that Go and Java are very similar indeed. Without goroutines, Go would be little more than a rewind of Java to a moment before J2EE happened. A major motivation for both languages was to take dangerous weapons out of the hands of mediocre programmers (or programmers made mediocre by being forced into large and ever changing teams). But I have to disagree on performance. What kills Java performance is memory consumption and the way memory is laid out. It has always been the number one killer. It killed Applets. It killed Java on the desktop. And it makes Java a bad choice for most server side infrastructure. I predict that Go is going to wipe out Java for that latter kind of task within 5 years if not less. Memory consumption is what constrains performance for most tasks. That's why most benchmarks are entirely irrelevant. Java's creators made two huge mistakes: 1) Throwing out structured value types, which is the root cause for Java's insatiable appetite for memory. 20 years of garbage collection research were unable to compensate for the damage done by not having structured value types. 2) Throwing out so many (supposedly too complex and too dangerous) meta programming features that everything meta had to be built around the language. Trading complexity at the language level for a much more unsound form of complexity on the runtime and tooling side is what caused the J2EE disaster. Go's creators avoided the first mistake but they are busy repeating the second one with even greater determination. |
|
Now, I don't know exactly what you mean by memory consumption, but if you mean total memory consumption by the JVM, that's a feature of the GC chosen, which usually trades extra RAM for added performance -- it certainly does not negatively affects performance.
As to point 2, I think that was Java's greatest decision (which Go can't replicate), because the malleability of bytecode afforded by class loaders and agents have made the JVM extremely flexible while at the same time extremely performant. At the language level, annotation processors -- really, AST transformers -- are extremely powerful (see the new pluggable type systems for Java 8) and not easy enough to abuse by under-qualified developers. If you want a more powerful language, the JVM offers quite a wide selection, which is another thing Go cannot do.