News for hackers. Stuff that matters.
Re:Tokio 1.0 – async runtime for Rust by lmm on Thursday December 24, 2020 @12:01AM (#25525188)
> Maybe it is undesirable because that often times plain mono-thread synchronous is fast enough, easier to read, easier to debug and safe to handle to a junior ? Not everybody in a team has the same level of expertise.

Shared-memory concurrency is pretty much always buggy, IME, even if your team thinks they're experts.

> And Rust is not an interpreted language. IMHO, interpreted languages should just drop to a compiled one to keep it KISS. Instead of going the async road, just to discover in production, it is unstable because back-pressure was not taken into account.

WTF? Switching to a compiled language doesn't magically make your threads nonblocking. Maybe you can serve 10x more users with a compiled language, but if we're talking about slow network requests then async can make your throughput thousands of times higher.

Re:Tokio 1.0 – async runtime for Rust by ldng on Thursday December 24, 2020 @01:18AM (#25525436)
Why WTF ?

You are reading something I did not write. I am not obsessed with the nonblocking mantra. Blocking is not inherently bad. Multi-processus is also a perfectly valid concurrency model.

Nor am I obsessing about being ultra performant to achieve the revered C10K when I don't need to or can get around it. That was my point.

Not everybody is Facebook or Netflix. For the vast majority of small and medium enterprises, it faster, simpler, safer (and possibly cheaper) to quickly develop a blocking program without thread and spawn multiple processes.

Re:Tokio 1.0 – async runtime for Rust by lmm on Thursday December 24, 2020 @01:40AM (#25525508)
> Why WTF ?

Because WTF does using a compiled language have to do with anything?

> Nor am I obsessing about being ultra performant to achieve the revered C10K when I don't need to or can get around it. That was my point.

Then what is it that you imagine using a compiled language would help with?

Re:Tokio 1.0 – async runtime for Rust by sagichmal on Thursday December 24, 2020 @05:33AM (#25526434)
> Shared-memory concurrency is pretty much always buggy, IME, even if your team thinks they're experts.

Writing bug-free shared memory concurrency programs with Go is trivial. Your opinion is based on outdated information.

Re:Tokio 1.0 – async runtime for Rust by ragnese on Thursday December 24, 2020 @06:20AM (#25526604)
I've definitely written buggy goroutine code before. AMA :p

I vaguely remember expecting a reference and getting a copy or vice versa...

I mean, I agree that Go is miles ahead of most other languages when it comes to helping prevent concurrency bugs, but it's sill tricky. Same with Rust.

Re:Tokio 1.0 – async runtime for Rust by sagichmal on Thursday December 24, 2020 @07:21AM (#25526897)
Go makes concurrency about as tricky as a reasonably complex data structure. can you still write a bug? Of course. Is it so tricky that bugs are inevitable, or even common? Absolutely not.
Re:Tokio 1.0 – async runtime for Rust by lmm on Thursday December 24, 2020 @08:18AM (#25527174)
Go's whole approach to concurrency is about avoiding sharing memory; channels suspend in much the same way as async/await yield points.
Re:Tokio 1.0 – async runtime for Rust by bsaul on Thursday December 24, 2020 @05:47PM (#25532230)
I like go, but i don’t understand your point. Go seems to like passing pointers over channels, which is pretty far from avoiding shared memory. Unless you start writing code that looks like actor based concurrency, with channels used to pass messages acrross actors. But this isn’t what i’d call idiomatic go.
Re:Tokio 1.0 – async runtime for Rust by lmm on Thursday December 24, 2020 @09:09PM (#25533561)
> Unless you start writing code that looks like actor based concurrency, with channels used to pass messages acrross actors. But this isn’t what i’d call idiomatic go.

Isn't that exactly what Go people push? "Don't communicate by sharing memory; share memory by communicating" and all that. If you start pushing pointers to shared memory around then I'd expect all of the problems of traditional multithreading to reappear.

Re:Tokio 1.0 – async runtime for Rust by zozbot234 on Friday December 25, 2020 @10:06AM (#25536847)
Passing pointers to shared memory is highly unsafe in Go. While the Rust borrow checker will prevent all data races, there's nothing like that wrt. Go.
Re:Tokio 1.0 – async runtime for Rust by sagichmal on Friday December 25, 2020 @11:09AM (#25537211)
> Passing pointers to shared memory is highly unsafe in Go. While the Rust borrow checker will prevent all data races, there's nothing like that wrt. Go

Passing pointers to shared memory is the foundation of a huge number of idiomatic, performant, and productive design patterns and architectures. There exist a number of conventions and tools, like the race detector, which reduce the risks of data races to entirely reasonable levels.

Re:Tokio 1.0 – async runtime for Rust by sagichmal on Thursday December 24, 2020 @07:05PM (#25532875)
Passing pointers over channels doesn't necessarily mean you're sharing memory, you could be passing ownership. Pointer or value are both equally idiomatic.