NullDeref
nullderef.com · Personal blog · on HN since 2021
NullDeref is a developer's blog about Rust, covering async versus sync code, plugins, API design, and also phone use.
What HN saysHN discusses his post on supporting both async and sync Rust code, with commenters citing its section on duplicating crates, and a piece on reducing phone use.
19HN people shared it
6linked it in comments
23stories submitted
235story points
1 year agolast shared
2021people per year2026
Most-shared posts
- 1The bane of my existence: Supporting both async and sync code in Rust8 people · 193 points · first shared 2024 · 155 comments on HN
- 2Plugins in Rust: The Technologies3 people · 5 points · first shared 2021 · discussion on HN
- 3Designing an API Client in Rust: New Rspotify Version a Year Later3 people · 5 points · first shared 2021 · discussion on HN
- 4Beyond Dumbphones2 people · 8 points · first shared 2024 · 2 comments on HN
- 5Why you shouldn't obsess about Rust “features”2 people · 5 points · first shared 2021 · discussion on HN
- 6Plugins in Rust: Diving into Dynamic Loading2 people · 4 points · first shared 2021 · discussion on HN
- 7I've quit my job to get you off your phone2 people · 2 points · first shared 2024 · 8 comments on HN
- 8Blindsided by Rust's Subtyping and Variance1 people · 4 points · first shared 2024 · discussion on HN
- 9Plugins in Rust: Reducing the Pain with Dependencies1 people · 3 points · first shared 2021 · discussion on HN
- 10Writing a Plugin System in Rust1 people · 2 points · first shared 2024 · discussion on HN
- 11Plugins in Rust: Getting Started1 people · 2 points · first shared 2021 · discussion on HN
- 12Optional Parameters in Rust1 people · 1 points · first shared 2024 · discussion on HN
- 13Plugins in Rust: Getting Our Hands Dirty1 people · 1 points · first shared 2022 · discussion on HN
- 14Phone jan251 people · first shared 2025
- 15Homepage1 people · first shared 2024
What HN people wrote when they linked it
nullderef · 2024-08-26
I've been thinking a lot about how to have healthier relationships with our phones. There are already dumbphones, but they're quite extreme and not everyone is willing to switch. So I wonder if there's anything else that could be done in between. Investigating and writing on my blog (https://nullderef.com) has been super fun so far.
anonymoushn · 2024-09-07
Cancellation isn't possible in general. For example, if you've kicked off expensive work on another thread or passed a pointer to your future to the kernel via io_uring, you must add a layer of indirection that's quite similar to a cancelation context. You can't just accept that the expensive work you don't care about will keep happening or resume a future that has been dropped when the cqe entry bearing a pointer to it arrives. The cancellation facility provided by io_uring that guarantees that you won't receive such a thing does so by blocking your thread for a while, which is undesirable.
As implemented, async/await typically greatly harms composability. For example see here: https://nullderef.com/blog/rust-async-sync/
In the specific case of Rust, we might begin to be able to write composable libraries a couple decades from now: https://github.com/rust-lang/keyword-generics-initiative
ozgrakkurt · 2025-07-13
You are skipping the massive point here.
If you are using a library in rust, it has to be async await, tokio, send+sync and all the other crap. Or if it is sync api then it is useless for async application.
This approach of passing IO removes this problem and this is THE main problem.
This way you don’t have to use procedural macros or other bs to implement multi versioning for the functions in your library, which doesn’t work well anyway in the end.
https://nullderef.com/blog/rust-async-sync/
You can find 50 other ones like this by searching.
To be honest I don’t hope they will solve cooperative scheduling, high performance, optionally thread-per-core async soon and the API won’t be that good anyway. But hope it solves all that in the future.
zer00eyz · 2024-04-30
I like rust, I write go.
There was a thread here the other day where a rust dev pointed out that "Rust is the language tokio ate"... https://nullderef.com/blog/rust-async-sync/
Rust is a lot of overhead when go is "good enough" for 99% of what needs to get done. That doesn't mean go is good for everything. I would still rather write Rust than C or C++ or bunch of other languages. Look at a project like Pingora, from cloud flair. Perfect Rust project, bad Go project. Rust is in the kernel, rust is what im looking at for a USB driver. I would not shove go in either of these places.
hermanradtke · 2024-01-19
The article has a whole section about the problems they ran into with two crates:
https://nullderef.com/blog/rust-async-sync/#_duplicating_the_crate