News for hackers. Stuff that matters.
Re:The State of Go by greg7mdp on Sunday February 05, 2017 @10:07AM (#13572648)
My impression is that Go is a language that was cobbled together to simplify the coding of some specific applications, such as simple servers. It lacks any kind of purity, is not the best choice for any specific task, but is just good enough for some (many?) tasks. And poor type safety!

Frankly, I can't help being disappointed by how bland this language is, and I have zero interest in using it. Maybe because I like coding, and the IMHO using Go or Java would totally kill the fun of it.

Re:The State of Go by rpercy on Sunday February 05, 2017 @10:36AM (#13572769)
To each their own. I enjoy writing Go almost as much as writing Python. But more importantly I find reading Go easier than any other language - mostly due to its explicitness and consistency between authors. That has made it much easier to dig into code bases that solve some very complex and interesting (to me, anyway) problems.

Also, I assume the 'no type safety' statement is just hyperbole?

Re:The State of Go by bitexploder on Sunday February 05, 2017 @12:29PM (#13573385)
They probably mean you can use interface{} and create a typing black hole if you really wanted to. Otherwise, I don't know.
Re:The State of Go by kuschku on Sunday February 05, 2017 @02:21PM (#13574016)
Or maybe they mean that you HAVE to use interface{} for any reasonable kind of generics, such as developing generic data structures, or generic handlers for RPC interfaces allowing arbitrary nesting?

Even the stdlib uses interface{} everywhere now: https://tip.golang.org/pkg/sort/#Slice

Re:The State of Go by bitexploder on Sunday February 05, 2017 @07:31PM (#13575630)
Is a good point. Smells of void pointers and old school Java collections.
Re:The State of Go by rcpt on Sunday February 05, 2017 @01:28PM (#13573679)
I've always believed that blandness is the reason why the language was created.

Google has a ton of developers working on a giant codebase. If Google were written in something interesting and complex (eg scala or ocaml) then some parts of the codebase would be remarkably complex while others would be simply a ton of library imports and then something procedural. Whether you are in the former or the later would be developer dependent.

Now, say you're a Google exec, you know you're losing a ton of developer hours as people ramp up to different parts of the codebase and that some parts are so complicated that only a few (expensive) engineers could ever work on them. The more you can remove differentiation between engineers and commoditize programming the less expensive specialists you'll have to deal with and (hopefully) things will get cheaper. There's a size at which the investment in creating a new, bland, language will pay off for you - hence golang.

Re:The State of Go by stcredzero on Sunday February 05, 2017 @02:01PM (#13573893)
It's more than "bland." There's a whole lot of "just works" in the whole ecosystem.

Now, say you're a Google exec, you know you're losing a ton of developer hours as people ramp up

Why wouldn't ramp-up time be a big company's most significant cost?

Re:The State of Go by aczerepinski on Sunday February 05, 2017 @10:13AM (#13572669)
But if you like typing `if err != nil` it's actually the most fun language.
Re:The State of Go by rpercy on Sunday February 05, 2017 @10:44AM (#13572826)
Heh, it does feel repetitive. But after ~10 years with Java, I'm happy to avoid the cognitive load from deciding how to most politely generate/propagate an exception. Obviously, there's no perfect solution, and preference is subjective.
Re:The State of Go by candiodari on Sunday February 05, 2017 @11:50AM (#13573180)
In reality Go makes it worse, if you truly keep track of all possible cases. After calling a method, in Go you have to

1) "if err != nil" after every statement

2) give some serious thought to whether the previous statement could panic or not

Good luck if it's a library call that may get updated or call other libraries !

3) Think about the non-error error cases that can't be abstracted out. Go is like C, in the sense that there is an ERETRY "error" (unsurprisingly, you should simply try again, you should NOT fail)

And there are cases where there can be an error and yet error is nil. Easy example of this would be sscanf.

And we now see practical Go code published online : how these problems are dealt with, real world edition:

1) either mindlessly putting "if err != nil { return err }", which is a very bad information-erasing exception system, or just outright ignoring errors. Don't you know you can also use "_" as the error variable ? Maybe they should make that implicit like in perl. Of course perl is likely to tell you this happened ... unlike C and Go.

(really brings back the C days doesn't it ?)

2) most people either don't know or just deny this. Thankfully panics at least do list where they occur. They also kill your program and print stacktraces. Pages and pages and pages of stacktraces.

3) very few people even know about these problems ... so they're ignored, and the standard Go tools themselves don't behave according to unix specifications.

Re:The State of Go by cube2222 on Sunday February 05, 2017 @12:20PM (#13573332)
Panic is pretty much never used (so you don't really have to think if the previous statement can panic. If it does it means something is SO wrong that your application can't continue anyways because it's broken)

You should really use a library like github.com/pkg/errors so you get to wrap the error you return with additional information. Errors are just a worse Either monad after allm they're much more pleasant to use than exceptions.

Re:The State of Go by leshow on Sunday February 05, 2017 @02:36PM (#13574104)
> Errors are just a worse Either monad after allm they're much more pleasant to use than exceptions.

How are errors in Go at all monadic? They just have a convention where you return a tuple and manually check if something isn't nil. Either type will inhabit one variant or another, not both with one having a value of nil.

The 'monadic' part of Either (or Result in something like Rust, where try! is sort of like >>= if you squint) is the ability to chain Either types together and have the boilerplate abstracted, that feature is completely absent from Go. Errors in Go are neither the Either type nor monad, IMO.

Re:The State of Go by cube2222 on Sunday February 05, 2017 @03:58PM (#13574608)
As I said, in practice they're a worse either monad. With which I meant -> they were inspired by them, but lack the monad part and having the value with the error in one object interchangeably. It's the same treating errors as values though.
Re:The State of Go by leshow on Sunday February 05, 2017 @10:30PM (#13576286)
It's really just a worse Either type, if anything, there's nothing monad about it. Although it's sort of hard to be close to an Either without being an algebraic data type. But I see what you're trying to say.
Re:The State of Go by geoka9 on Sunday February 05, 2017 @01:18PM (#13573629)
> Panic is pretty much never used (so you don't really have to think if the previous statement can panic. If it does it means something is SO wrong that your application can't continue anyways because it's broken)

That's it. I think OP just assumed panics in Go are what exceptions are in other languages.

Re:The State of Go by kuschku on Sunday February 05, 2017 @02:25PM (#13574048)
Because the stdlib is using them more and more? As someone mentioned, even closing an already closed channel can panic. Calling the random number generator with a negative limit panics.

And there’s nothing like checked Panics so you’d know if one will happen or not.

Re:The State of Go by cube2222 on Sunday February 05, 2017 @04:00PM (#13574618)
As I said, if your code is plainly wrong then I see no problem in it going haywire. The channel rules are widely known -> you know, it takes more than a few days to learn a language, there are a few rules to learn too.

Calling a number generator with a negative limit is also a programmer fault, so no reason to provide an error here.

Re:The State of Go by candiodari on Monday February 06, 2017 @08:11AM (#13579091)
Yes, there is no problem as long as you agree with X about what is a "real" error and what isn't.

X includes

the language authors (who are using this more and more in the stdlib as pointed out elsewhere)

the authors of any library you use ... but

transitively, so this includes the authors of any library you use indirectly as well

Hmmmm ... what was the problem with (unchecked, or python's) exceptions again ?

Re:The State of Go by geoka9 on Sunday February 05, 2017 @03:06PM (#13574277)
I see nothing wrong with that - those _are_ fatal conditions that indicate that something is dangerously wrong in the program.

And those panics do give you a helpful stack trace, complete with source code line numbers, so it's easy to find the culprit (as opposed to "bubbling up" exceptions).

Re:The State of Go by twic on Sunday February 05, 2017 @03:54PM (#13574579)
These uses of panic look a lot like the canonical use of unchecked exceptions in Java: the programmer has made an error, which they could have avoided. It's a bug. There's no point returning an error and letting the program try to recover, just blow up with as much information as you can, so the bug can be fixed.

The canonical use of checked exceptions in Java is for unpredictable events - almost always related to interaction with the outside world, like IO, networking, parsing, etc. These are things the programmer can't prevent, and must defend against, so the type system allows, and in fact forces, the programmer to explicitly address them.

This is all explained beautifully, and at length, in this monograph:

http://joeduffyblog.com/2016/02/07/the-error-model/

Re:The State of Go by kuschku on Sunday February 05, 2017 @05:11PM (#13574969)
> There's no point returning an error and letting the program try to recover, just blow up with as much information as you can, so the bug can be fixed.

Well, imagine a game letting the user roll a dice. "Chose a number of sides for your dice".

In such cases, handling such a panic might be useful. And knowing that it exists might be useful, too.

If the language does not allow specifying a range of a type (for example, requiring all numbers passed into the RNG to be positive), then it should be specified in the API in other ways programmatically, so it can be statically analyzed.

Re:The State of Go by cube2222 on Sunday February 05, 2017 @05:37PM (#13575111)
You should ALWAYS check the input you get from users. So this really wasn't a good counter argument.
Re:The State of Go by kuschku on Sunday February 05, 2017 @08:09PM (#13575789)
As I said above, panics should ideally never be able to occur, but be part of the type system.

In languages with dependent types, for example, it’s common to represent a Stack in a way that number and type of elements are stored in the type (so you can’t even pull from an empty stack – that’d be a compile time error).

In the same way, the random number generator should either return an error, or use a number type that can only encode positive numbers as input.

Especially if combined with the interface{} everywhere across the new stdlib functions this all smells very much like C's problems.

Re:The State of Go by stefano on Sunday February 05, 2017 @11:41AM (#13573138)
It's the same cognitive load, really. Instead of deciding how to best propagate exceptions, you're now deciding how to best propagate the error value.
Re:The State of Go by rpercy on Sunday February 05, 2017 @11:55AM (#13573207)
Not really. In a language like Java, some of the questions I'd have to ask myself are:

  - Should I try to catch the exception, or just let it 
    bubble up and edit my interface to include it?
  - Should I create a new exception type or reuse an existing one?
  - Should I throw a checked or unchecked exception?
  - Am I exposing implementation details via my interface? 
    (eg I don't want to throw an SQLException from GenericDataSourceWidget.connect())
In golang, I know there's really just the one pattern: check if err != nil, prepend a descriptive message, and return it.
Re:The State of Go by Groxx on Sunday February 05, 2017 @01:01PM (#13573561)
>check if err != nil, prepend a descriptive message, and return it.

That'd be the RuntimeException equivalent, sure. But what do you do for the equivalent of checked exceptions? Errors are frequently recoverable, "err != nil" alone does nothing to help you there, and string manipulation is a horrific alternative to types.

Re:The State of Go by cdelsolar on Sunday February 05, 2017 @02:09PM (#13573948)
You can have typed errors too. This is fairly common in Go. As long as it implements the Error interface.
Re:The State of Go by Groxx on Sunday February 05, 2017 @02:15PM (#13573981)
At which point you're back to the original complaint of:

  - Should I try to catch the exception, or just let it 
    bubble up and edit my interface to include it?
  - Should I create a new exception type or reuse an existing one?
  - Am I exposing implementation details via my interface? 
    (eg I don't want to throw an SQLException from GenericDataSourceWidget.connect())
(except for "- Should I throw a checked or unchecked exception?" since that's fairly Java-specific)

To me, those questions seem unavoidable, and sweeping them under the rug is a false simplicity. You're exposing things - what do you expose? How should the caller deal with it? Is it the same as [other thing]? I'd much rather have the type system involved, since error handling is pretty critical to correctness/stability. If go's giving up the safety, what does it get in return?

Re:The State of Go by XorNot on Sunday February 05, 2017 @07:53PM (#13575721)
I feel like the type system is involved? If there's a problem it's that Go doesn't make throwing typed errors a common convention (and we lack the tooling to make handling them a habit I.e. inspect this call and find me all the error types which can come back.
Re:The State of Go by hota_mazi on Sunday February 05, 2017 @02:21PM (#13574019)
> I'm happy to avoid the cognitive load from deciding how to most politely generate/propagate an exception

This is like saying "I'm happy to avoid the cognitive load of having to specify how my code should behave in case of an error".

Sure, your code is simpler as a result. It's also more buggy.

Re:The State of Go by _ak on Sunday February 05, 2017 @02:21PM (#13574021)
It makes cyclomatic complexity explicit that is otherwise hidden by exceptions.
Re:The State of Go by shurcooL on Sunday February 05, 2017 @01:29PM (#13573689)
How's that different from typing `for`, `switch`, or any other way of using a language?
Re:The State of Go by jrs95 on Sunday February 05, 2017 @10:20AM (#13572698)
It's used very heavily for everything container related. It seems to be an excellent fit there, at the very least. It's also becoming an increasingly popular choice for startups when they need performance, which used to be something Java or C++ were typically used for.

Personally I've had a lot of fun using it, but prior to starting with it I'd mostly done Java and Node, so that may have something to do with it.

Re:The State of Go by sidlls on Sunday February 05, 2017 @12:26PM (#13573369)
I'm not convinced that using startups as a metric for anything programming related is a good idea. At least not startups here in the Bay Area, which seem to me to be very fad driven.
Re:The State of Go by Cthulhu_ on Sunday February 05, 2017 @02:42PM (#13574130)
Today's startups are tomorrow's huge stack of legacy software that Nobody Wants To Touch Because It's Our Core Business though; I'd say Go is a pretty good choice for those due to its simplicity and shunning of 'clever' code. Companies like Paypal, Ebay, and probably a few others have (had?) a huge load of old Java code and only recently spent a lot of time cleaning that up (iirc Paypal went with Node, at least for its forward-facing things)

I don't know how maintainable 10-year old Ruby code is though, on the other hand.

Re:The State of Go by sidlls on Sunday February 05, 2017 @06:23PM (#13575352)
Today's startups are, mostly, tomorrow's failed businesses. The majority of the most successful startups of the last 15 years have generally used tried-and-true battle tested technologies in their successes: Java, C, C++ and PHP.

This isn't to say Go doesn't belong in that list, but simply to reinforce my point that what startups are using today shouldn't be an indicator of high quality technology that can (or should) gain more traction and use in the future.

Re:The State of Go by jpgvm on Sunday February 05, 2017 @08:39PM (#13575924)
And Ruby. Ruby is basically the new Java. As in it's no longer cool but is considered battletested and is now at the core of 10+ year old companies with code bases just as old that noone enjoys working on anymore.
Re:The State of Go by sidlls on Sunday February 05, 2017 @11:11PM (#13576424)
That may be, in which case Python belongs in the same bucket. I'm not convinced, actually. Most of the "ruby shops" I know use it only for the most trivial of applications, being essentially rest-like proxies between clients and Java (or other language) services. But I don't know everything and anecdotes aren't data for sure.
Re:The State of Go by solidsnack9000 on Sunday February 05, 2017 @06:32PM (#13575403)
That legacy software has come out of the web or backend stack of startups? Most of Facebook is written in PHP but Cassandra is written in Java.
Re:The State of Go by jrs95 on Sunday February 05, 2017 @12:41PM (#13573445)
That is a good point, and it definitely is. But in this particular case I think it makes sense, although there's probably a "shiny" factor to it as well.
Re:The State of Go by greg7mdp on Sunday February 05, 2017 @11:08AM (#13572955)
How can you write an efficient container without generics?
Re:The State of Go by bsg75 on Sunday February 05, 2017 @04:12PM (#13574672)
Use a language that has generics.

Snarky, but its such a tiresome argument. If you need something Go does not supply, use a language that fits your needs. There are a lot of programmers happy in Go, and thus happy without generics.

There are programmers who are happy using generics, thus write in Rust, Java, etc.

There is no language to bind them all.

Re:The State of Go by Zach_the_Lizard on Sunday February 05, 2017 @11:20AM (#13573020)
By copy and pasting or code generation, as we've unfortunately had to do. Makes for messy things like DateRange paired with DateRangeInterval tree vs. a generic Range that works with an IntervalTree.
Re:The State of Go by bboreham on Sunday February 05, 2017 @12:24PM (#13573350)
Container as in "Docker container"
Re:The State of Go by prodigal_erik on Sunday February 05, 2017 @02:07PM (#13573938)
That's just a jailed process. There's no reason to need a completely different language, especially one without any specific support for running untrusted code.
Re:The State of Go by jrs95 on Sunday February 05, 2017 @03:42PM (#13574518)
Well clearly that isn't a requirement, it just so happens that Docker, rkt, and most related technologies are all built with Go. etcd even uses grpc
Re:The State of Go by jpgvm on Sunday February 05, 2017 @08:41PM (#13575927)
gRPC isn't Go specific in any way. In fact I would imagine it's main implementation would be in C++, secondly Java and then maybe Go.
Re:The State of Go by labrador on Sunday February 05, 2017 @11:19AM (#13573007)
I keep reading this and I keep wondering what's stopping someone familiar with language design from writing generics code
Re:The State of Go by Zach_the_Lizard on Sunday February 05, 2017 @11:45AM (#13573160)
They seem to take a lazy approach to feature development. Generics are complicated and bad, but having makeIntMap or makeStringSlice is...not great for developer productivity.

So let's special case `make()`, slices, channels, etc. so that some productivity is possible.

Then as they add library features they violate their own tenants as they find utility in these verboten constructs. Exceptions are bad...But we have panics which are in no way the same thing renamed. Never expose them outside a package...But closing an already closed channel panics. Random number generator functions panic on mundane and expected things, just like Java checked exceptions.

Example:

https://golang.org/pkg/math/rand/

``` func (Rand) Int31n

func (r Rand) Int31n(n int32) int32 Int31n returns, as an int32, a non-negative pseudo-random number in [0,n). It panics if n <= 0. ```

Standard behavior would be returning an error, not panicking,

See this:

https://blog.golang.org/defer-panic-and-recover

``` The convention in the Go libraries is that even when a package uses panic internally, its external API still presents explicit error return values. ```

It's just an inconsistent and, quite frankly, disappointing language outside of goroutines and its interfaces. Those two make it possible to be productive, but with generics for instance a whole slew of new possibilities will emerge.

The simplicity is nice, but it's too simple and too inconsistent. All the verbosity of Java combined with the impenetrable inconsistency and abbreviations of C.

Re:The State of Go by randomdata on Sunday February 05, 2017 @01:21PM (#13573644)
I wonder this too. For how important generics are claimed to be, it does seem strange that nobody has stepped up and helped out the core team in this capacity. They have been quite open about wanting generics, but do not have the resources to dedicate to implementing them in an acceptable fashion. But being an open source project, anyone can step up to fill that void.
Re:The State of Go by algesten on Sunday February 05, 2017 @02:03PM (#13573907)
How can a google backed project not have the resources?
Re:The State of Go by randomdata on Sunday February 05, 2017 @02:50PM (#13574174)
I don't know, but Google does frequently complain about not being able to find talent. Some of this is through fault of their own, but it is easy to imagine that they have not found suitable developers to fill the spot, for whatever reason it may be. They have lots of other business goals for what developers they do have. Putting their people on generics at the cost of some other business function may not be a good choice, even if it is theoretically possible.
Re:The State of Go by pjmlp on Sunday February 05, 2017 @02:53PM (#13574194)
It would be wasted work, because no one in the community would take it.

So better spend that time contributing to other parts of the Go ecosystem, or another programming language project.

Re:The State of Go by Buttons840 on Sunday February 05, 2017 @02:36PM (#13574101)
I've been thinking about a two way compiler with a primary focus on producing readable code. If such a compiler targeted Go or Java, you could white your "Go+" code (for lack of a better name) in a higher level language with more features, and have it compiled to readable Go code. I don't know to what extent this is possible, but if it was good enough you could be a Go developer while rarely writing actual Go code.
Re:The State of Go by zzzcpan on Sunday February 05, 2017 @03:08PM (#13574289)
It is very much possible, there are already DSLs that generate Go code. I'm even doing that myself.
Re:The State of Go by solidsnack9000 on Sunday February 05, 2017 @06:34PM (#13575413)
Can you link some examples?
Re:The State of Go by stefantalpalaru on Sunday February 05, 2017 @12:10PM (#13573284)
You can have your generics and many other nice things combined with the gccgo goroutines, channels and garbage collector by switching to Nim: https://github.com/stefantalpalaru/golib-nim
Re:The State of Go by mseepgood on Sunday February 05, 2017 @10:21AM (#13572701)
> And no type safety!

90% type safety (probably even more) is more than no type safety. It's not a holy grail that all programming must strive for.

Re:The State of Go by dtech on Sunday February 05, 2017 @10:38AM (#13572782)
It's a balance, but I am fairly disappointing that such an up-and-coming language has such a limited type system. In the days where even traditionally fully untyped languages are moving toward inferred, optional and static typing [1],[2],[3] I'm disappointed to see `interface {}` sprinkled throughout Go API's.

[1] JS Typescript and flow: https://www.typescriptlang.org/, https://flowtype.org/

[2] Python with mypy: http://mypy-lang.org/

[3] PHP with Hack: http://hacklang.org/

Re:The State of Go by mseepgood on Sunday February 05, 2017 @12:51PM (#13573511)
> In the days where even traditionally fully untyped languages are moving toward inferred, optional and static typing

This only shows that the sweet spot is probably not in the extremes, but somewhere in between the dynamic type system - paranoid type system spectrum.

Re:The State of Go by donpark on Sunday February 05, 2017 @10:36AM (#13572771)
Go's blandness is a feature to me. It's not a joy to write but pleasant to read and understand which, sadly, won't matter unless Golang gains more popularity.
Re:The State of Go by rpercy on Sunday February 05, 2017 @11:04AM (#13572931)
100% agree re: readability (as I've mentioned elsewhere).

I've actually been very surprised at the near-ubiquity of Go in the modern infrastructure/tools space though. Seems like each new OSS product I evaluate is written in Go. See companies like Cloudflare, Hashicorp, InfluxData, CoreOS, and, obviously, big projects like Kubernetes.

Re:The State of Go by IshKebab on Sunday February 05, 2017 @12:42PM (#13573450)
I think that's mostly because Go trivially generates static binaries, and cross-compiling is also trivial (as long as you don't use CGo).

I can't actually think of a single other language that matches that. Rust might get there one day but cross-compiling still requires a C cross-compiler (ugh) and C dependencies (e.g. OpenSSL) are often dynamically linked.

Re:The State of Go by steveklabnik on Sunday February 05, 2017 @03:29PM (#13574427)
Cross compiling shouldn't require a C compiler unless you have a dependency on C code.

Most wrappers should at least provide an option to statically link the C; I know the OpenSSL ones do.

Re:The State of Go by IshKebab on Monday February 06, 2017 @02:18PM (#13582906)
Not a C compiler, but you need a C linker, which is just as much hassle. Apparently there is work going on to use LLVM's lld linker, which I guess might support cross-compiling in a sane way but I haven't checked.

And yeah most wrappers provide a static linking option but there's not much consistency which is rather annoying.

Re:The State of Go by user5994461 on Sunday February 05, 2017 @11:48AM (#13573176)
Go is meant for distributed systems. All these companies, and generally speaking a lot of infrastructure thing is in that domain. They use the right tool for the job.
Re:The State of Go by MichaelGG on Sunday February 05, 2017 @12:11PM (#13573294)
Can you elaborate on why Go the language is "meant for" distributed systems?
Re:The State of Go by mseepgood on Sunday February 05, 2017 @12:45PM (#13573482)
It has been explained on multiple occasions by the language designers what they meant it for, e.g. https://talks.golang.org/2012/splash.article
Re:The State of Go by shurcooL on Sunday February 05, 2017 @01:31PM (#13573703)
For me, Go is the most fun language I've ever used after 15+ years of programming. I like how simple and consistent, yet powerful it is.
Re:The State of Go by spraak on Sunday February 05, 2017 @01:44PM (#13573792)
I don't disagree about the type safety and general qualities of the language, but saying "Maybe because I like coding" is really unnecessary language egotism. There are many, many people who love coding and love doing it in Go.
Re:The State of Go by hlandau on Sunday February 05, 2017 @10:36AM (#13572768)
Personally I like Go; it's a very fun language for me. It's true that it sometimes feels like a language designed for the precise purpose of writing daemons, but that's exactly why I like it.

The thing about Go is that its opinions on concurrency are ones I share, to the point where I was practically waiting for something like Go to be invented. Other than say, Erlang, I'm not aware of many alternatives which provide a) ultra-cheap coroutines (10,000 coroutines? fine!), b) an I/O system which is seamlessly integrated with that concurrency system (and in a totalitarian manner at that; if you're using Go, you're using its event-based I/O scheduler, no exceptions), and c) a rock-solid runtime.

[IO SYSTEM.] The imposition of Go's I/O system is important, because it means all Go code is written using the same I/O system, which makes code reuse much more feasible. The chances of you being able to integrate a random OSS library that you discover in say, C++ into your C++ project is much lower:

I call design decisions that pervade every line of code in a project "cross-cutting considerations" (CCCs). These are design decisions where changing your mind means rewriting every line of code, or at least reviewing every line to see if it needs rewriting. Your ability to consume a library depends on where your project and the library sit in CCC-space, an n-dimensional space. If your project is written using an asynchronous I/O reactor, and the library uses a traditional synchronous, sockets-based programming model, you're screwed. You can't use that code, unless you maintain a fork (and in that case you'd have to transform the library into the continuation-passing style, etc.). If the I/O is pluggable, you have to go through the effort of plumbing it into the reactor library you've chosen to use, just to be able to consume that library.

Not only does "using Go" imply the I/O system that goes with it, Go's tightness in language design means you don't see the feature rejection that you see in a language like C++. C++ isn't a language, it's a family of languages; everyone chooses their own subset of C++ to code in. Some people think exceptions are bad and avoid them, and some people think templates are bad and avoid them, etc.

What this means is that the statement "this library is written in Go" is a hell of a lot more meaningful than the statement "this library is written in C++". It's not just C++ either; Python for example now offers a wide variety of choices for I/O, which inflates the CCC-space across which the language's ecosystem of libraries are distributed. One library could use asyncio, one something Twisted-like, one synchronous calls, one threads, etc.

[COROUTINES.] It's the right way to do concurrency. Not the continuation passing style; it's truly preposterous that programmers have been made to write in a format originally intended to be implemented as a compiler transformation. Only recently are we seeing languages augmented with async/await keywords to allow this transformation to be performed behind the scenes (JavaScript, Python 3, C#). Erlang has been around a long time making the CPS look ridiculous, and later there was Stackless Python, an ignored gift horse to the Python community. Stackless Python failed to be a real alternative to Erlang, Go, etc. because it never managed to get a thriving ecosystem or IIRC, a standard I/O system around it.

I also perceive that Go has almost completely accidentially obtained some additional fondness for the fact that it produces statically linked, portable binaries. If you're shipping only Go code, you may often be able to get away without using containers when they'd otherwise be essential. You see Go binaries for Linux being distributed officially by OSS projects when normally for Linux that's very rare; it's left to package managers, and you have distro differences making compatibility potentially tricky.

The fact that Go shipped with a standard, configuration-free build system also makes creating new libraries, or bringing in existing ones almost completely frictionless. Even if you think Go is boring as a language, what really makes it stand out is its execution. Just look at how they're improving the GC with every release.

(This turned into an essay... I guess my ultimate point is that getting a coroutine-based highly-scalable I/O programming environment to work as an ecosystem requires you to standardize on one runtime completely and utterly, and be able to trust that runtime with production workloads. The only such systems I can think of which are stack based and which formed successful ecosystems are Go and Erlang; though now we're seeing a lot more CPS-based systems using async/await annotation, which are probably more than good enough for the same applications. Although I would point out that neither Python 3 nor JavaScript are trying to occupy the multi-thread m:n scheduling space in the same way that Go and (I think?) Erlang are. They're constrained to essentially single-thread operation.)

Re:The State of Go by nicolast on Sunday February 05, 2017 @11:54AM (#13573203)
> Other than say, Erlang, I'm not aware of many alternatives which provide a) ultra-cheap coroutines (10,000 coroutines? fine!), b) an I/O system which is seamlessly integrated with that concurrency system (and in a totalitarian manner at that; if you're using Go, you're using its event-based I/O scheduler, no exceptions), and c) a rock-solid runtime.

GHC Haskell.

Re:The State of Go by jiaweihli on Sunday February 05, 2017 @02:15PM (#13573985)
Also Akka for Java/Scala.
Re:The State of Go by hellofunk on Sunday February 05, 2017 @05:52PM (#13575189)
Re: green threads

The C++ Actor Framework is awesome

https://actor-framework.org

Re:The State of Go by stcredzero on Sunday February 05, 2017 @01:59PM (#13573882)
It lacks any kind of purity

What language is pure anything? Even Smalltalk wasn't pure Objects. Programming languages are pretty complex. If you look deep enough, you'll find the leak in the abstractions.

Re:The State of Go by Thaxll on Sunday February 05, 2017 @10:54AM (#13572886)
Not using Java the #1 server language? What do you code your server in C++?
Re:The State of Go by geodel on Sunday February 05, 2017 @09:34PM (#13576117)
Some(A lot of?) people use programing language just for day job. For them Java or Go would just do fine.
Re:The State of Go by bsg75 on Sunday February 05, 2017 @04:10PM (#13574664)
> It lacks any kind of purity

Example of lack of purity?