News for hackers. Stuff that matters.
Re:Lies we tell ourselves to keep using Golang by fasterthanlime on Friday April 29, 2022 @10:42AM (#31205794)
> As far as I know, no other popular language allows you to read from multiple queues at the same time

Off the top of my head, that's certainly possible in Rust, C++ and Java - probably many others I just don't know about.

That particular bit of concurrency goodness comes from the 70s, so you can be sure other languages picked it up.

Re:Lies we tell ourselves to keep using Golang by npe on Friday April 29, 2022 @11:16AM (#31206229)
As I understand it, he's talking about select/alt (i.e. guarded commands from CSP) being a native feature of the language rather than callback-based approaches. It's possible to implement CSP channels in most languages, but they're not first-class like go.
Re:Lies we tell ourselves to keep using Golang by samhw on Friday April 29, 2022 @11:31AM (#31206445)
> It's possible to implement CSP channels in most languages, but they're not first-class like go.

But does that matter? In all my experience, I can't think of any instances where that wouldn't be a distinction without a difference. (Perhaps I'm missing something, though.)

Re:Lies we tell ourselves to keep using Golang by npe on Friday April 29, 2022 @11:52AM (#31206749)
It matters a lot IMO. Most systems programming languages can implement whatever concurrency primitives you care to use, but most people default to whatever is provided by the OS/language because concurrency is hard. Having first-class syntactic sugar over a concurrent runtime bakes in a certain programming style in the language, which strongly determines how the language is used and the programming style. Go comes out of the Newsqueak/Aleph/Limbo family which has a very different style of programming compared to a lot of other languages.
Re:Lies we tell ourselves to keep using Golang by samhw on Friday April 29, 2022 @01:48PM (#31208483)
I think there's a difference between 'in the standard library' and 'in the language', though. They seem to be praising Go for doing the latter. And the technical language in which it was expressed gave me to think there was some technical motivation for that, as opposed to sociological - but if what they meant is what you said, then I certainly wouldn't disagree with that.
Re:Lies we tell ourselves to keep using Golang by npe on Friday April 29, 2022 @04:06PM (#31210036)
I'd argue that Go is explicitly sociological. Most of the novel ideas in Go (process calculi/guarded commands in a concurrent language) were originally embedded in Cardelli and Pike's Squeak back in the 80s. The rest is trying to standardize the way scalable web applications are built.
Re:Lies we tell ourselves to keep using Golang by fasterthanlime on Friday April 29, 2022 @11:37AM (#31206517)
Defaults matter because friction matters, but friction there is largely removed by having a decent package manager, so I personally don't think it matters (though the topic of "what batteries should be included" has far from run its course).
Re:Lies we tell ourselves to keep using Golang by npe on Friday April 29, 2022 @11:56AM (#31206814)
The minute you put language constructs in the base syntax and runtime of the language, it's a lot more than friction. Love it or hate it, Go is inextricably tied to CSP.
Re:Lies we tell ourselves to keep using Golang by Mawr on Friday April 29, 2022 @06:47PM (#31211487)
It's the opposite - pointing out that X can just as well be implemented in language Y is the irrelevant point because anything can be implemented in any turing complete language.

Where languages differ is what they make easy to use, or first class.

As an example consider Go's autoformatter gofmt. It got released with the language, pushed and marketed as the way to format your code - first class. As a result, virtually all Go code is uniformly formatted. Contrast that with autoformatters in other languages pre-Go. They existed, but often multiple per language, each with hundreds of configuration options, all with minimal uptake in their ecosystems.

Re:Lies we tell ourselves to keep using Golang by paskozdilar on Friday April 29, 2022 @11:21AM (#31206289)
If you could spare some time, would you please demonstrate an example? Any language of those mentioned would be OK.
Re:Lies we tell ourselves to keep using Golang by fasterthanlime on Friday April 29, 2022 @11:45AM (#31206629)
Here's a Rust example, with tokio: https://play.rust-lang.org/?version=stable&mode=debug&editio... - I don't have time to come up with Java/C++ examples, but I'm sure others will.

(If your point was about it being _built into the language_, then it definitely stands, see the other discussion in the parent comment thread)

Re:Lies we tell ourselves to keep using Golang by paskozdilar on Friday April 29, 2022 @02:35PM (#31209026)
Yeah, I guess I overestimated the complexity of such mechanisms. I mean, still, you need some kind of runtime for the asynchronicity, but the Rust version seems fairly OK (apart from the function coloring, but that's another story).

I guess I just like it being built into the language. Plus no function coloring (everything is asynchronous, but appears synchronous) really makes it easy to build complex systems.

Re:Lies we tell ourselves to keep using Golang by autarch on Friday April 29, 2022 @12:05PM (#31206956)
Re:Lies we tell ourselves to keep using Golang by thestoicattack on Friday April 29, 2022 @11:19AM (#31206267)
Ada too, I think.
Re:Lies we tell ourselves to keep using Golang by pyjarrett on Friday April 29, 2022 @11:52AM (#31206745)
Ada has had this built-in for decades, and even allows selecting from one of multiple waiting queues (entries) using a `select` keyword.