Better HN
topnewbestaskshowjobs
Log inSign up

jafffsuds

5 karma · joined May 24, 2026 (6mo ago) · 3 submissions

Submissions

comment 6mo ago · link · parent

> There’s no built-in goroutine-style preemption. Long CPU-bound work in an async task starves the executor; you offload to tokio::task::spawn_blocking or rayon instead.

I don't know why anyone uses spawn_blocking for CPU-bound tasks. It's clearly designed for blocking IO tasks. There's a reason why Erlang cordons them separately into Dirty CPU and Dirty IO schedulers.

comment 6mo ago · link · parent

He's been busy with the typescript-go project

comment 6mo ago · link · parent

What you are describing is something different called a disjoint union which will maintain the identities of the left and right values when there is overlap.

The C# unions appear to behave like unions, not disjoint unions.