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.
[ Parent
| on HN ]
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.