@PlexSheep@feddit.de
link
fedilink
10
edit-2
9M

Async rust with the Tokio Framework is pretty cool. Need none of that JS bloat for async.

Async Rust sucks. I hate how many libraries use it, forcing it apon you.

@deur@feddit.nl
link
fedilink
7
edit-2
9M

You suck, I hate how your comment was forced “apon” me. Anyone who claims things that they can easily avoid if theyre so opinionated against them are “forced upon” them are always pathetic people.

cooljacob204
link
fedilink
1
edit-2
9M

Have you programmed with rust a day in your life? Once you introduce one library that requires Tokio async you have to start wrapping all your calls that involve it in async shit.

So many better concurrency patterns out there.

And these libraries are not easily avoidable. Ex: most AWS libraries require it.

And forgive me for a stupid typo, I have had little sleep the last week but you are an asshole that thinks belittling people somehow makes you right so it doesn’t really matter.

Honestly I can’t wrap my head how to effectively put computation into a thread, even with Tokio.

All I want is something like rayon where you got a task queue and you just yeet tasks into a free thread, and await when you actually need it

Might be too much JS/TS influence on me, or that I can’t find a tutorial that would explain in a way that clicks for me

Tokio is for concurrency, not parallelism. Use it for IO stuff. They say rayon is good for that, but I haven’t used that. If you just want something simple, I’d recommend working with threadpool.

Spaz
link
fedilink
39M

Tokio specifically says not to use it for CPU intensive tasks and rayon would be better for this: https://tokio.rs/tokio/tutorial

Speeding up CPU-bound computations by running them in parallel on several threads. Tokio is designed for IO-bound applications where each individual task spends most of its time waiting for IO. If the only thing your application does is run computations in parallel, you should be using rayon. That said, it is still possible to “mix & match” if you need to do both. See this blog post for a practical example

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 77 users / day
  • 211 users / week
  • 413 users / month
  • 2.92K users / 6 months
  • 1 subscriber
  • 1.53K Posts
  • 33.8K Comments
  • Modlog