News for hackers. Stuff that matters.
Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by nine_k on Thursday May 09, 2019 @03:32PM (#19871468)
Java had become the industry's workhorse also without generics, that were included only in Java 5, 8 years after Java 1.0. C++ had it for ages by that time, but it did not help its adoption too much (if not the other way around).

Go's very lack of expressive power is what helps make it an enterprise language. It's simple enough and limiting enough so that a non-brilliant developer has little trouble picking it up, and is unlikely to run into a complicated corner case. As statistics inevitably have it, half the developers are below median level, by definition.

The really smart stuff in Go, like goroutines scheduling or lightning-fast GC, is all under the hood, and you don't get to touch it, and don't have to.

You can see the same pattern in other wildly successful languages of the past, such as Fortran, Cobol, Visual Basic, or PHP.

Having one of the largest IT corporations backing the language and actively using it does help, too. But I would not exaggerate this factor: Python got to the top without a comparable corporate support from its creators.

Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by booleandilemma on Thursday May 09, 2019 @04:08PM (#19871869)
Java had become the industry's workhorse also without generics...

Yeah but now that we have generics the bar has been raised right?

I’m not giving generics up, that’s for sure.

Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by geodel on Thursday May 09, 2019 @07:19PM (#19873472)
Well of course you don't need to. Individual/independent developers would use what they deem fit. It is corporate developers who will receive mandate to use a particular language or technology. For example a large company where I work, it is mostly Java shop. However the new telemetry/tooling group has now mandated to use Go. So about 40+ devs are working in Go. Nobody asked their opinion about Go vs Java or Generics , Sum types, exception vs errors and so on. Same devs would have used Weblogic/Websphere or whatever if asked.

Developers in this categories are not going to say "LOL J2EE" or "LOL Go". They will do whatever being asked and collect paycheck in return. If they chose to be independent voice, they are going to be asked to leave and make way for devs who comply.

Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by copperx on Thursday May 09, 2019 @04:19PM (#19871985)
Java had the Object superclass, and that's how generic methods and classes were written before version 5.

Is there a Go equivalent of Object?

Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by adamlett on Thursday May 09, 2019 @04:32PM (#19872127)
Yes. The empty interface.
Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by hyeomans on Thursday May 09, 2019 @04:08PM (#19871867)
Talking about coroutines, how do you do a synonym of async/await + Promise.all + cancellation token?

In a microservice world, I habe to send a request to 6 microservices and I want to do them concurrently not sequentially

Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by nine_k on Thursday May 09, 2019 @04:22PM (#19872025)
Spin several goroutines, do a `select` on them. It's right in the Tour of Go.

Cancellation tokens are harder, though.

Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by tonyarkles on Thursday May 09, 2019 @07:22PM (#19873498)
It’s been a while since I’ve been writing Go, but wasn’t that nominally what the Context objects were supposed to be for? I think they were introduced a bit late in the game, but APIs that supported them handled cancellation well (if I’m remembering right)
Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by owaislone on Thursday May 09, 2019 @07:57PM (#19873733)
Context would be passed to each go-routines for cancellation but the pattern would be the same as OP's suggestion. I'd say a set of go-routines and a sync.WaitGroup would probably be a better pattern for this use case. Routines + select is more useful for listening on incoming data than concurrently sending out bytes.
Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by omani on Thursday May 09, 2019 @04:13PM (#19871931)
use zeromq
Re:Go Is on a Trajectory to Become the Next Enterprise Progr... by smnplk on Thursday May 09, 2019 @04:05PM (#19871838)
>> Python got to the top without a comparable corporate support from its creators.<<

Yeah, but Google did a lot for python adoption.