News for hackers. Stuff that matters.
Re:Seven years of Go by _ph_ on Thursday November 10, 2016 @06:53PM (#12925900)
As I said, generics are missing, and the core team is working at them. But I really appreciate that they do not implement something like the Java generics.

If your code produces errors, you can of course add location information like stack traces, there is an API for that.

I have not benchmarked Go against Java explicitly, but I do benchmark against C and it compares very nicely in performance to C code, so for most tasks it should be as fast or faster than Java code. Go gives you more flexibility about memory layout (true value types), which keeps GC times down.

I am a programmer, with 20 years of Java on my belt and I quite love Go.

Re:Seven years of Go by candiodari on Friday November 11, 2016 @05:42AM (#12929517)
> I have not benchmarked Go against Java explicitly, but I do benchmark against C and it compares very nicely in performance to C code,

On average, Go code is about 50% as fast as C code in calculations and algorithms, usually, and has more lines of code for equivalent functionality without cheating. Do your benchmarks tell you something different ?

Java is about 10% slower than C. 30% or so if you "don't cheat" (meaning write a direct translation of C code into java, e.g. using char[] instead of string)

There's also that C encourages you to write faster code, at least it does for me. Java, Go, and every other language I know, encourage me to do string mangling by making lots of temporary strings. C doesn't really allow for that, instead making me think about doing in-place string editing, which is far, far faster than using copies. Of course, get the tiniest little detail wrong and it'll blow up, but there's no beating it in speed.

Re:Seven years of Go by _ph_ on Friday November 11, 2016 @07:35AM (#12930039)
Yes, in my daily experience, Go is roughly on par with C code. There are a few constructs that the Go compiler does not optimize yet (jump tables), but other than that they are pretty close.