News for hackers. Stuff that matters.
Re:The Rust I wanted had no future by throwawaymaths on Monday June 05, 2023 @02:39PM (#36200995)
> a zero-cost abstraction

It's just an abstraction, it's not zero-(runtime)-cost. It might be the "lowest possible cost", still nonzero.

Re:The Rust I wanted had no future by mplanchard on Monday June 05, 2023 @07:44PM (#36205984)
A zero cost abstraction is just an abstraction you couldn’t write any better yourself, not one that is actually free. If you’re lookint for an item in a hashmap, you still have to pay the cost of looking up the key. The promise of zero-cost abstractions is that you’re paying the lowest possible cost to do that, with a nice interface that you didn’t have to write from scratch.
Re:The Rust I wanted had no future by throwawaymaths on Monday June 05, 2023 @08:05PM (#36206208)
Agreed, that's why I said might. Whether rust async is the best possible abstraction probably depends on the event loop, and your code. I could be wrong but I think if you write a trivial async function it will still have spinach for the async even if there are no yield points and it's effectively a non async function