byronr
Joined 6 years ago
Joined 6 years ago
So even if I can predict how a particular JVM will treat a given jar, I'm still stuck if my code might be deployed across a range of JVMs.
I say all this having written orders of magnitude more Go, with apologies to the Java programmers.
The difference is of course the JIT -- with Go the single binary means you can disassemble it to find out what it's trying to do. JIT adds a layer of mystery.
Also, with Go it's largely possible to avoid heap allocations in performance hotspots. With Java I'm not so sure.
I would pick Go for any large project in a heartbeat.
I have to concur that the haters who post to HN probably have never used this language in earnest.
Here's what you get out of the box:
* Extensive standard library * Cheap concurrency * Fast compilation * Built-in test/benchmark framework, including coverage and race detection * Built-in heap and CPU profiling
Of all the complaints the one I understand the least is the reservations about performance. It is within 10-20% of C, and callouts to C and assembly are possible. (My 8-way multiplexed MD5 routine was written in AVX assembler and lives on in minio.) Extracting that last 10-20% is two or three sigmas away from the norm of how programming languages are used these days.
The objection to generics is similar. The lack of generics shows up -- once in a long while. It doesn't prevent me from being immensely productive with this language.
Looking back at the last few years I've wondered if I could have accomplished what I did in Go by using a different language (C in particular) and the answer, for me, is "not a chance".
Your question has another angle: why would I care to work for an employer who looked down on my IOCCC win? It acts as a filter both ways.
http://a.papnet.eu/UNIX/bltj/06771910.pdf
Suggest you read this before denigrating Rob Pike's bona fides. Not sure what axe you are trying to grind but it is ugly and unbecoming of a professional.
Rob Pike has written window system software which ran in what now would be called a "thin client" over a 9600 baud modem and rendered graphics using a 2MHz CPU. He probably knows a thing or two about performance tuning.
Bellermann wrote about a pedal solo that Bach played: he “ran over the pedals so quickly that his feet appeared winged, with a thundering fullness of sound, and penetrated the ears of the listeners like a bolt of lightning”, and that he “was admired in amazement” by Prince Frederick van Hessen. The prince removed a jewelled ring from his hand on the spot and gave it to Bach. If he had earned that just with the speed of his feet, wondered Bellermann, what would the prince have given him if Bach had used his hands as well?
func apply(fn, x, a Addr) Addr {
if atom(fn) == T {
switch fn {
case CAR:
return caar(x)
case CDR:
return cdar(x)
case CONS:
return cons(car(x), cadr(x))
case ATOM:
return atom(car(x))
case EQ:
return eq(car(x), cadr(x))
default:
return apply(eval(fn, a), x, a)
}
}
switch car(fn) {
case LAMBDA:
return eval(caddr(fn), pairlis(cadr(fn), x, a))
case LABEL:
return apply(caddr(fn), x, cons(cons(cadr(fn), caddr(fn)), a))
}
panic(errint("bad node: " + car(fn).String()))
}
On the perf side: I'm curious to know where Go sits now relative to C assuming you elide away all heap allocations in your inner loops. In the early days Go's codegen was based on plan9's simple and simplistic C compiler's back end. Things have gotten much better since then and to my knowledge it's within striking distance of C. But I could be wrong.