News for hackers. Stuff that matters.
Re:Introduction to Go 1.1 by SagelyGuru on Tuesday March 26, 2013 @05:09AM (#5442015)
Good work! While speedups of go of the order of 30% in general are a good thing, they do point at the relative immaturity of the language. You would not be able to get these kinds of seedups in gcc, where tings presumably already are close to optimal.

Another worry I have is the 'backwards compatibility'. It sounds good but in the long run creates its own problems. I think Java and even Python run into major problems with this.

Re:Introduction to Go 1.1 by fulafel on Tuesday March 26, 2013 @05:17AM (#5442039)
> [Speedups] point at the relative immaturity of the language. You would not be able to get these kinds of seedups in gcc, where tings presumably already are close to optimal

If you actually follow the links, you will see they are reimplementations of the algorithms in assembly.

GCC doesn't have any crypto code, fast or otherwise. Crypto algorithms routinely get dramatic speedups when going from C to hand-coded assembly, C compilers produce code that is far from optimal. See eg. http://cr.yp.to/aes-speed.html

Re:Introduction to Go 1.1 by laumars on Tuesday March 26, 2013 @05:30AM (#5442079)

    > Another worry I have is the 'backwards compatibility'. It sounds good
    > but in the long run creates its own problems. I think Java and even
    > Python run into major problems with this.
At this point in Go's life, it makes more sense to be backwards compatible as the last thing you want to do is turn your back on your small current developer base. As Go grows and people have started adapting to the changes, then you can start depreciating the old stuff.
Re:Introduction to Go 1.1 by LeonidasXIV on Tuesday March 26, 2013 @06:18AM (#5442212)
Exactly. For an example of doing it wrong, check out D. D is a great language (I'm reading The D programming language and it became one of my favorite books), but they broke compatibility between D1 and D2 and I am not even sure D2 is compatible with itself.

And the compiler support is not yet mature. GDC has missed inclusion into GCC 4.8, while Go went into GCC 4.7, which makes using Go possible on a number of platforms and configurations.

Re:Introduction to Go 1.1 by pjmlp on Tuesday March 26, 2013 @08:28AM (#5442735)
That was mainly related to political issues with the language's runtime, which are sorted now.
Re:Introduction to Go 1.1 by melling on Tuesday March 26, 2013 @10:14AM (#5443389)
Even though they are somewhat contrived benchmarks, I still like to refer to the "Language Shootout" to get some idea of the quality of code that the Go compiler is producing. I would expect the numbers should be better than Scala, for example.

http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?t...

Re:Introduction to Go 1.1 by gillianseed on Tuesday March 26, 2013 @12:06PM (#5444188)
Yes I too find the Language Shootout a very interesting benchmark (while knowing full and well it's shortcomings) and it shows (imo) that Go has alot of work to do in the optimization department, something one can confirm by compiling cpu intensive go code using gccgo which will often yield great performance improvements.

Not surprising though, as GCC's optimization backend is very strong and has been developed for a long time, meanwhile Go's compiler toolchain is very young.

As for Scala vs Go, Scala compiles into Java bytecode and then makes use of Java's excellent and very mature JIT compiler so I'm not surprised Go loses out to it for the same reasons mentioned above.

Also note that the Go version used on the 'Language Shootout' is the 1.03 version, not the upcoming 1.1 version, it will be interesting to see what improvements in performance have been made.

AFAIK the 32-bit version of Go (which is what you compared with in your link) has not been given as much love in the optimization department as the 64-bit version, which I guess would do slightly better atleast.

Re:Introduction to Go 1.1 by onan_barbarian on Tuesday March 26, 2013 @08:16PM (#5446929)
Go's compiler toolchain is not "very young". Go's compiler toolchain is derived from the Plan 9 C compiler and is a decade older than modern gcc (4.x), which has substantially rewritten its optimization framework relatively recently with "GENERIC" and "GIMPLE". There are no equivalent changes in the go backend.

The reason the code quality (in optimization terms) of Go's compiler isn't that great is that the Plan 9 C compiler was always designed for fast compiles. This is a matter of design.

Re:Introduction to Go 1.1 by Scaevolus on Wednesday March 27, 2013 @02:51AM (#5448185)
The Go compiler converts its AST to assembly directly. There's a peephole optimizer and certain AST patterns are specially handled, but overall the compiler is extremely simple.

By comparison, LLVM/GCC passes code through multiple internal representations and performs many complex optimizations on them before emitting assembly.

Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @12:16PM (#5444266)
>>while knowing full and well it's shortcomings<<

Without knowing it's name :-)

Re:Introduction to Go 1.1 by gillianseed on Tuesday March 26, 2013 @12:30PM (#5444374)
heh, well it was called the 'computer language shootout' back in the day and that's the name that has stuck with me.
Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @12:36PM (#5444412)
Back in the day, that old project wasn't on quad-core and wasn't on Ubuntu -- and we should wonder whether your understanding of what's shown is also 6 years out-of-date ;-)
Re:Introduction to Go 1.1 by mturmon on Tuesday March 26, 2013 @01:42PM (#5444866)
@igouy: you have now made three comments without any substance, but which question the expertise of the original commenter on the basis of a small issue of nomenclature.

If you have something specific to say, say it.

Re:Introduction to Go 1.1 by gillianseed on Tuesday March 26, 2013 @01:16PM (#5444686)
even if I google 'language shootout' the top link is the (now) correct 'Computer Language Benchmarks Game' and what is shown there is not 6 years old.

Is there a point to you continuing to spin on this???

Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @01:22PM (#5444733)
Given that the banner shown on every web-page changed, do you think there might be other changes which you haven't noticed?
Re:Introduction to Go 1.1 by gillianseed on Tuesday March 26, 2013 @02:03PM (#5445001)
Like what? I come there for the benchmark results and for looking at the source code versions presented for the languages I'm interested in. The banner is of very little concern to me, which is why it hadn't registered with me.
Re:Introduction to Go 1.1 by im_dario on Tuesday March 26, 2013 @11:49AM (#5444077)
Just a note: Language Shootout is still Go 1.0.3. We are going to wait to see the new benchmarks.
Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @12:15PM (#5444259)
Go 1.0.3 is the latest release.
Re:Introduction to Go 1.1 by voidlogic on Tuesday March 26, 2013 @12:53PM (#5444519)
True, but it is worth pointing out because this discussion is about 1.1 and people might not realize those are 1.0.3 benchmarks.
Re:Introduction to Go 1.1 by voidlogic on Tuesday March 26, 2013 @01:08PM (#5444637)
"I would expect the numbers should be better than Scala, for example"

Maybe once 1.1 is out and the language game switches to it, that will be the case (the benchmark is using the current stable release of Go 1.0.3).

Also, I assume you are talking about execution time, Go destroys Scala in your linked comparison in terms of memory usage.

Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @01:28PM (#5444777)
Please don't generalize from the memory use of those programs

http://programmers.stackexchange.com/a/189552

Re:Introduction to Go 1.1 by voidlogic on Tuesday March 26, 2013 @01:43PM (#5444874)
Interesting. It is pretty amazing and unfortunate after all these years (18?) Sun/Oracle hasn't made the default JVM memory allocation more adaptive/intelligent. Could the JVM -Xms option be used to try to mitigate this defect?

One note, Scala uses more memory than Java does, so it appears not all of this usage can be blamed on the JVM itself: http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?t...

Re:Introduction to Go 1.1 by igouy on Wednesday March 27, 2013 @01:30PM (#5450760)
Perhaps it is intelligent for the kind-of applications the JVM is designed for (rather than for tiny tiny toy programs).
Re:Introduction to Go 1.1 by voidlogic on Thursday March 28, 2013 @12:34PM (#5455853)
There are lots of useful commandline tools written in Java that would no doubt benefit. P.S. I did not downvote.
Re:Introduction to Go 1.1 by igouy on Thursday March 28, 2013 @02:11PM (#5456579)
That may be -- but are commandline tools the kind-of applications the JVM is designed for?
Re:Introduction to Go 1.1 by igouy on Thursday March 28, 2013 @12:29PM (#5455821)
Why the downvote?

Do you really think the JVM memory-use should be optimised for 100 line toy programs?

Re:Introduction to Go 1.1 by trailfox on Tuesday March 26, 2013 @01:02PM (#5444596)
> I would expect the numbers should be better than Scala

Why would you expect that? The JVM has years worth of advanced optimizations.

Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @12:18PM (#5444274)
Where should we look for the "Language Shootout"?

The link you provided doesn't point to anything called that.

Re:Introduction to Go 1.1 by melling on Tuesday March 26, 2013 @12:22PM (#5444307)
Google it and see what you get. I typed "language shootout debian" to find the result. I guess Google still remembers its old name.
Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @12:32PM (#5444384)
You are nearly 6 years out-of-date. (Google "Sun Java" and see what you get, really.)
Re:Introduction to Go 1.1 by melling on Tuesday March 26, 2013 @01:04PM (#5444608)
Sun was purchased by Oracle for $8 billion dollars. It was big news. The Language Shootout changing its name didn't register. It's simply not that important. I understand now that the name has been change, but in a year when I feel like Google'ing it again, I can promise how I'm going to search for it, or refer to it.

On another note, your threads about the name change are adding little value to the conversation. Perhaps the time could be better spent? You are sort of wasting people's time. Next time, maybe simply say that the "Language Shootout" has been changed to the "Benchmark Game?"

Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @01:16PM (#5444687)
>> It's simply not that important.<<

It's important as an indicator of how much or how little you noticed when you looked at those web pages.

Re:Introduction to Go 1.1 by eridius on Tuesday March 26, 2013 @05:30PM (#5446192)
I think the name is the least important thing on the page. Why are you so fixated on it?
Re:Introduction to Go 1.1 by igouy on Wednesday March 27, 2013 @01:47PM (#5450890)
It's a simple glaring example of not seeing what actually is shown on the web pages.

The other ways people don't see what actually is shown are more difficult -- taking memory use and code size measurements out-of-context.

Re:Introduction to Go 1.1 by stefantalpalaru on Tuesday March 26, 2013 @07:12AM (#5442408)
Python shoot itself in the foot by breaking compatibility in version 3 and not even providing automated transition tools (like Go does). Look beyond the propaganda and notice the interval between the launch of Python3 and major libraries being ported to it.
Re:Introduction to Go 1.1 by jerf on Tuesday March 26, 2013 @09:15AM (#5442991)
You mean like http://docs.python.org/2/library/2to3.html ?

Static typing arguably makes it easier to provide a deeper and more accurate translation, but Python did at least try. And note that's a link to Python's official docs, not a side project or something; 2to3 was created by the core Python team as part of the official upgrade path, not an afterthought.

Re:Introduction to Go 1.1 by stefantalpalaru on Tuesday March 26, 2013 @11:45AM (#5444049)
"Sometimes 2to3 will find a place in your source code that needs to be changed, but 2to3 cannot fix automatically. In this case, 2to3 will print a warning beneath the diff for a file. You should address the warning in order to have compliant 3.x code."
Re:Introduction to Go 1.1 by jerf on Tuesday March 26, 2013 @02:57PM (#5445318)
Sorry, that's goalpost hiking. You said they didn't provide an automated transition tool, not that it wasn't perfect. Go's tools will only issue warnings in some cases too, so I'm really lost as to what you think you're saying here.
Re:Introduction to Go 1.1 by sigzero on Tuesday March 26, 2013 @09:41AM (#5443144)
That is a poor comparison at best. Guido laid down a 5 year transition plan from Py2 to Py3 and that is actually working very nicely.
Re:Introduction to Go 1.1 by stefantalpalaru on Tuesday March 26, 2013 @11:52AM (#5444093)
> a 5 year transition plan from Py2 to Py3 and that is actually working very nicely

For whom? Five years is long enough to realize that you might as well try new languages instead of porting all your code base (and maybe some libraries that you need) to the slightly improved but backwards incompatible version of Python.

Re:Introduction to Go 1.1 by jemeshsu on Tuesday March 26, 2013 @09:20AM (#5443024)
To be fair, Go promises only single version compatibility. Which means all point releases 1.x will be backward compatible. I can see Go 2 breaking compatibility.
Re:Introduction to Go 1.1 by stefantalpalaru on Tuesday March 26, 2013 @11:48AM (#5444062)
So far "go fix"[1] took care of incompatible changes pre-1.x .

[1] http://golang.org/cmd/fix/

Re:Introduction to Go 1.1 by mseepgood on Tuesday March 26, 2013 @05:17AM (#5442038)
Wasn't it Python 3 having major problems by not being backwards compatible? Django still doesn't support Python 3.
Re:Introduction to Go 1.1 by ldng on Tuesday March 26, 2013 @06:04AM (#5442177)
Actually it does since last release. But they are not supporting it, yet. Most probably because surrounding libs haven't yet been adapted to Python 3.
Re:Introduction to Go 1.1 by Goranek on Tuesday March 26, 2013 @05:56AM (#5442156)
Django 1.5 is also the first release with Python 3 support