News for hackers. Stuff that matters.
Re:Async Rust Is A Bad Language by lmm on Friday September 08, 2023 @10:16PM (#37441545)
> I've always wondered why the "color" of a function can't be a property of its call site instead of its definition. That would completely solve this problem - you declare your functions once, colorlessly, and then can invoke them as async anywhere you want.

If you have a non-joke type system (which is to say, Haskell or Scala) you can. I do it all the time. But you need HKT and in Rust each baby step towards that is an RFC buried under a mountain of discussion.

Re:Async Rust Is A Bad Language by OvermindDL1 on Friday September 08, 2023 @10:30PM (#37441636)
You can do it without HKTs with an effects system, which you can think of as another kind of generics that causes the function to be sliced in different ways depending on how it's called. There is movement in Rust to try to do this, but I wish it was done before async was implemented considering async could be implemented within it...