3 ms·
It's funny how it took Java almost a decade to finally implement goroutines.
by bheadmaster 4y ago
It's funny how it took Java almost a decade to finally implement goroutines.
- kaba0 4y agoAs opposed to what platform? Also, they did that in a completely backwards compatible way, so that programs that were written before Go was even a thing will also benefit, so if you will, Java has out of the doors orders of more “goroutine”-aware code as is, than Go will likely ever will.
- bheadmaster 4y ago> As opposed to what platform? Go. > programs that were written before Go was even a thing will also benefit As far as I understand virtual threads, they have a new API for creating them, so older programs will at the very least need some source change and a recompilation in order to use them. Of course, if there's a JVM flag to automatically use virtual threads in place of OS threads, please correct me :) > Java has out of the doors orders of more “goroutine”-aware code as is, than Go will likely ever will. I honestly doubt that older code is "goroutine"-aware, as virtual threads are used in a different way than ordinary OS threads. I don't think there's any code that spawned hundreds of thousands of OS threads before, which would be the main benefit of using virtual threads.
- pjmlp 4y agoYou mean the co-routines that Modula-2 already had in 1978, or Erlang in 1986, not such big achievement on Go's part. By the way, JVM green threads were available in 1996, however eventually red threads became the default implementation across all major JVM vendors.
- bheadmaster 4y ago> You mean the co-routines that Modula-2 already had in 1978, or Erlang in 1986, not such big achievement on Go's part. What are you implying, that Go should've implemented goroutines before Go even existed?
- pjmlp 4y agoThat just like everything else in Go, it is only new for those that don't have their CS history up to date.
- bheadmaster 4y agoI never said a word about its novelty, I only pointed out it's funny how it took 10 years for Java to implement exactly the same functionality, because of how complex Java is. Even when implemented, some potholes in the implementation have yet to be fixed. There's no need for such implicit insults.
- redditor98654 4y agoWhere is the decade coming from? From what I know the loom project was started a few years ago, perhaps in 2019.