News for hackers. Stuff that matters.
Re:Tell HN: Lois - Golang like channels for Java by fauigerzigerk on Monday April 14, 2014 @07:16AM (#7585494)
What's the difference to java.util.concurrent.BlockingQueue?
Re:Tell HN: Lois - Golang like channels for Java by mrphoebs on Monday April 14, 2014 @07:36AM (#7585571)
It's not pass by reference, it's pass by value. And also I like this abstraction better.
Re:Tell HN: Lois - Golang like channels for Java by ap22213 on Monday April 14, 2014 @10:04AM (#7586184)
What is a case in which you'd want pass by value in a queue? I mean sometimes you're forced to pass by value, but if you have the option of pass by reference, why would you choose by value?

Maybe I've been doing this stuff too long, but it's not all that hard to make an object safe for concurrency. But, I am probably missing some context.

Re:Tell HN: Lois - Golang like channels for Java by mrphoebs on Monday April 14, 2014 @10:23AM (#7586304)
While I agree it's not hard to make an object safe for concurrency, knowing how to do it effectively is another matter. In an organization or team where there are engineers at all levels of familiarity with java, getting concurrency right is a PITA.

Additionally in this context, the very basis of the channel mechanism is "share state by communicating, don't communicate by sharing state". Also pass by value lends itself well to remoting if I choose to go in that direction.

Re:Tell HN: Lois - Golang like channels for Java by eternalban on Monday April 14, 2014 @06:30PM (#7589299)
There is /no/ silver bullet for the complexity of concurrency. If in a large team of uneven experience every developer is expected to address concurrency issues, then the problem is architectural.

> "share state by communicating, don't communicate by sharing state"

The elegance of this approach is very clear. But note that even in Go, when performance is critical, traditional mechanisms of locks and shared memory objects are used. (The fact that such constructs are even provided in the language should be informative to you.)

> [transparent] remoting

I recommend you read this: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.41.7...

Re:Tell HN: Lois - Golang like channels for Java by scotth on Monday April 14, 2014 @07:47AM (#7585620)
Wow. Sounds like some serious overhead.
Re:Tell HN: Lois - Golang like channels for Java by fauigerzigerk on Monday April 14, 2014 @07:49AM (#7585627)
I see. I'm afraid in a mutable world that causes all kinds of serialization issues and unpredictable performance. Java developers are not used to knowing their object graphs very well.