News for hackers. Stuff that matters.
Re:Guido says goodbye to Google by pjmlp on Saturday December 08, 2012 @02:55AM (#4891089)
Go will replace Java when it will offer generics, same GC execution speed and the amount of libraries Java currently enjoys.

Channels and Goroutines are easily available in java.util.concurrent.

If you really want compilation to pure native code, there native code compilers for Java as well.

Re:Guido says goodbye to Google by _ak on Saturday December 08, 2012 @03:33AM (#4891142)
> Channels and Goroutines are easily available in java.util.concurrent.

HAHAHAHAHAHAHAHAHAHA. No.

Re:Guido says goodbye to Google by pjmlp on Saturday December 08, 2012 @03:59AM (#4891194)
With your childish comment you just showed how much you know about programming, zero!
Re:Guido says goodbye to Google by _ak on Saturday December 08, 2012 @05:26AM (#4891316)
Yeah, right. Just take a closer look what goroutines really are (hint: not threads), and how Java threads differ from them.
Re:Guido says goodbye to Google by nickik on Saturday December 08, 2012 @06:04AM (#4891362)
You show your ignorance again. Do you think that go does not use operatingsystem threads in the background? Do you think the same abstraction could and has not been built for java? How do you think does the Erlang impmentation on Java work? How do you think that scala can start so many actors? How do you think the forkjoin framework works?
Re:Guido says goodbye to Google by _ak on Saturday December 08, 2012 @01:19PM (#4892258)
Funny how we talk about Go and Java and you suddenly come up with Scala and Erlang.
Re:Guido says goodbye to Google by nickik on Saturday December 08, 2012 @03:53PM (#4892668)
Scala runs on the JVM and I said Erlang running on Java (granted I meant JVM). I was refering to this: https://github.com/trifork/erjang
Re:Guido says goodbye to Google by pjmlp on Saturday December 08, 2012 @01:37PM (#4892312)
Goroutines are what is known as green threads in Java land.

The Java specification allows for green threads, N:1 mapping of threads, or system threads, 1:1 mapping to system threads.

It is up to the Java VM or compiler to offer one implementation or even both.

Tasks in java.util.concurrent make use of thread pooling to also achieve N:1 mapping of tasks to threads.

The Squawk and the Cacao VMs are two examples of a Java VM using green threads,

http://labs.oracle.com/projects/squawk/

http://www.cacaojvm.org/

Re:Guido says goodbye to Google by pretoriusB on Saturday December 08, 2012 @06:12AM (#4891376)
Well, you and your "hint" are mistaken.

From the documentation:

"Goroutines are multiplexed onto multiple OS threads so if one should block, such as while waiting for I/O, others continue to run".

Same thing as in Java, just integrated into the language instead of a library. But then again, Scala offers that too.

Re:Guido says goodbye to Google by _ak on Saturday December 08, 2012 @01:17PM (#4892249)
You quote things you don't understand. n goroutines (where n is big) get multiplexed to m threads (small m, typically numbers of cores). Goroutines are cheap: each goroutine starts at a size of 4k, and creating them is a really cheap operation. Please show me a Java thread implementation with the same properties. Good luck with that.
Re:Guido says goodbye to Google by pjmlp on Saturday December 08, 2012 @02:56PM (#4892525)
Re:Guido says goodbye to Google by pretoriusB on Sunday December 09, 2012 @05:58AM (#4894432)
>n goroutines (where n is big) get multiplexed to m threads (small m, typically numbers of cores).

You had the same thing in early Java with green-treads -- it is abandoned for modern JVMs, but you can mimic it. You can have millions of Scala actors.

>Goroutines are cheap: each goroutine starts at a size of 4k, and creating them is a really cheap operation.

Yes, but handling and migrating them is a "not really cheap operation". They are mostly useful as abstractions, as for performance you don't get anything over Java (if not worse: checkout Go vs Java concurrency benchmarks).

>Please show me a Java thread implementation with the same properties. Good luck with that.

Not sure I need all that "luck" you wish me. How about Java on Solaris, which multiplexes java threads to native threads?