Re:Why I went from Python to Go (and not node.js)
by irahul on Friday September 14, 2012 @04:54PM
(#4523908)
> I don't remember where I saw it, but someone talked about using Go in contrast with Java, and the overwhelming reaction was "that's cool but I'm a Python programmer, I'm curious what Python programmers think", so I was just trying to give it that angle.
I have seen more Python/Ruby programmers interested in Go than Java or C++ programmers. Rob Pike seems to have observed it as well.
I was asked a few weeks ago, "What was the biggest surprise you encountered rolling out Go?" I knew the answer instantly: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Very few come from C++.
http://commandcenter.blogspot.in/2012/06/less-is-exponential...
Re:Why I went from Python to Go (and not node.js)
by outworlder on Friday September 14, 2012 @04:36PM
(#4523816)
> but this is part of the problem: it's a library. Concurrency deserves language-level support. Adding concurrency at the library level is like adding an object system at the library level.
Which is not a problem at all. Lisp and Scheme have been doing that since forever.
Re:Why I went from Python to Go (and not node.js)
by scott_s on Friday September 14, 2012 @06:50PM
(#4524381)
I assume they depend on macros to do so? That changes the game. Hans Boehm has an excellent paper on this issue titled "Threads Cannot be Imlemented as a Library": http://www.hpl.hp.com/techreports/2004/HPL-2004-209.pdf That paper was published in PLDI (http://dl.acm.org/citation.cfm?id=1065042).
His arguments have much to do with what the compiler doesn't know, which could potentially be solved with macros.
Re:Why I went from Python to Go (and not node.js)
by pcwalton on Friday September 14, 2012 @09:17PM
(#4524839)
You don't need macros to solve this problem. You can use unique types, STM, etc. to forbid the data sharing at the type level and ensure a coherent memory model.
Re:Why I went from Python to Go (and not node.js)
by scott_s on Friday September 14, 2012 @09:51PM
(#4524922)
The paper's position is that you can't implement threads, safely, as a library because the compiler is not aware of the concurrency. My point was that this reasoning may not hold if your language has full macros. Your suggestions will work great, but those are in the compiler, not as a library.
Re:Why I went from Python to Go (and not node.js)
by pcwalton on Friday September 14, 2012 @11:46PM
(#4525219)
Well, the point is that concurrency primitives don't have to be built into the language to enable libraries to write safe concurrent abstractions. Rather, the type system features that enable it can exist in the compiler as general type system features unrelated to concurrency that just so happen to be able to ensure the safety of concurrent code if used properly.
Re:Why I went from Python to Go (and not node.js)
by scott_s on Saturday September 15, 2012 @06:12PM
(#4527471)
I take your point, but I find it unlikely that anyone would defined the correct language semantics that would guarantee correct results under concurrency without designing for concurrency. Which is the point of Boehm's paper: your language (and its compiler) need to know about concurrency in order to get it right.
Re:Why I went from Python to Go (and not node.js)
by zvrba on Saturday September 15, 2012 @02:34AM
(#4525519)
But these arguments are pretty much invalid today: C++11 introduces explicit support for concurrency, and the compiler MUST be aware of it, even though it may look (on the surface) as a "library".
Re:Why I went from Python to Go (and not node.js)
by scott_s on Saturday September 15, 2012 @05:02PM
(#4527289)
Note that the paper's author was one of the people who defined C++'s memory model for this very reason.
Re:Why I went from Python to Go (and not node.js)
by reinhardt on Friday September 14, 2012 @06:15PM
(#4524271)
Their (lack of) popularity suggests that the "at all" part might be a bit too absolute.
that was deliberate. There has been a glut of "introduction to Go" blog posts, and the documentation for introductory Go from the Go Team is quite good, so I didn't feel the need to author another introductory post. Most of the stories about why people use Go are bigger, established companies, so I wanted to show how it was perceived by a different audience. I don't remember where I saw it, but someone talked about using Go in contrast with Java, and the overwhelming reaction was "that's cool but I'm a Python programmer, I'm curious what Python programmers think", so I was just trying to give it that angle.
>Have a look at concurrent.futures
but this is part of the problem: it's a library. Concurrency deserves language-level support. Adding concurrency at the library level is like adding an object system at the library level.