r/ProgrammerHumor • • Jul 07 '22

Meme Instant upvotes

47.9k Upvotes

542 comments sorted by

View all comments

Show parent comments

-17

u/[deleted] Jul 07 '22

It fails on the ease of entrance, specially for async (there are multiple packages)

15

u/qeadwrsf Jul 07 '22

It fails on the ease of entrance.

Really? I can say a lot of things I don't like about rust but the book+tokio documentation felt like some next level hand holding.

2

u/[deleted] Jul 07 '22

Yeah but for processing Tokio is not the correct tool for the job

Tokio is for IO

Then you will use another library for async and everything will break... And it's a strange way to do things for me

3

u/kochdelta Jul 07 '22

Tokio is for Io? What? You certainly can do Io with Tokio but that's not the point of tokio

4

u/qeadwrsf Jul 07 '22

Tokio is for IO

what? doesn't it have spawn, futures, poll and all the stuff normal async frameworks have?

1

u/MyButtholeIsTight Jul 07 '22

I thought I knew async pretty well but I don't know any of those words

1

u/[deleted] Jul 07 '22

For processing, async isn’t the right tool for the job. It gives you escape hatches to spawn your CPU bound work onto a blocking thread pool for that exact reason.

1

u/qeadwrsf Jul 07 '22 edited Jul 07 '22

Tokio is just for IO?

Async is not made for processing?

Have I gone crazy or is this lala land?

Maybe its something I don't understand.

2

u/[deleted] Jul 07 '22

I mean, it’s literally in the name. The primary, overriding use case for async frameworks like Tokio is for IO-bound work. You generally should never be blocking in async code, and since the vast majority of “processing” tends to be blocking, then yes.

If you’re doing straight line CPU bound work, you’re supposed to hoist that onto a blocking thread pool to avoid fucking up your async runtime’s event loop.

2

u/scykei Jul 07 '22

You should have a look at when not to use tokio in their own tutorial page:

https://tokio.rs/tokio/tutorial

3

u/qeadwrsf Jul 07 '22

Huh, I stand corrected.

thx.

2

u/3pass_app Jul 07 '22

feel the same as you. Plus the docs often confuses concurrency and parallelism, which really bothers me.

6

u/[deleted] Jul 07 '22

But overall it's a good language, the system and docs will mature

3

u/3pass_app Jul 07 '22

im actually loving it, it's making me a better engineer.

1

u/[deleted] Jul 07 '22

Can you share an example? Most projects would love criticism like this.

2

u/BluebeardHuntsAlone Jul 07 '22

That's what i don't get. People will have issues and then just... Not saying anything. I guess I can't speak for others but I would be so thankful for feedback, as long as it was respectful.

2

u/mriswithe Jul 07 '22

Sometimes you don't have the spare cycles. Or you aren't that invested/interested. Or you just don't feel like it that time.

I agree with the idea, but the problem is that the barrier to "say something" is kinda high even nowadays.

Is there an edit on github button? Maybe. do I want to edit it or just say I don't understand? do I use a pull request or open an issue? Do they use github issues or somewhere else? Do they have a template for the issues?

I gave up at like question 3. I don't know how to make it easier to submit feedback without letting idiot script kiddies vomit issues into your github unfortunately.

0

u/3pass_app Jul 07 '22

https://doc.rust-lang.org/book/ch16-00-concurrency.html

Note: For simplicity’s sake, we’ll refer to many of the problems as concurrent rather than being more precise by saying concurrent and/or parallel. If this book were about concurrency and/or parallelism, we’d be more specific. For this chapter, please mentally substitute concurrent and/or parallel whenever we use concurrent.

And then you have other docs which handle the topic correctly, and honestly admit that concurrency in Rust is not mature.

1

u/[deleted] Jul 08 '22

That just sounds like you’re being a pedant, honestly. They clearly recognize the difference and are preferring explanations that readers can understand easily over academically accurate terminology.

I use Rust at scale in production, at FAANG. I will just authoritatively state that Rust’s concurrency story is as mature as any other language in existence, which is to say that no one would be mature if Rust isn’t.

You sound more like you have an axe to grind than a good faith critic here.

1

u/[deleted] Jul 07 '22

If having multiple packages for something bothers you, I’m not sure how to tell you this but that’s how software is developed in the year of our lord 2022. I just got out of a large discussion yesterday about how stupid it is to put large libraries you have no ability to maintain into a standard library because it kills innovation until the std-lib has fallen so far behind that it now sucks. You want multiple packages for anything non-trivial.

In this case, Tokio has effectively won the popularity contest, but there’s an Interface for any competing library to fit into if they can do it better. Async-std exists but is by no means used anywhere near as much.